Static vdom branches diffing optimization #1981
maciejhirsz
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Consider scenario such as:
The
<h1>
tag is never changing, but it still has to be diffed on every render. It should be relatively easy for thehtml!
macro to identify that the entire branch of the DOM is static, and produce some unique id for it at compile time (u64
fnv hash of the wholeTokenStream
would be the most naive), and then attach it at the rootVTag
of the<h1>
(VTag
is already boxed, so another field there shouldn't make much of a difference).On runtime the
PartialEq
could then check if theOption<u64>
of the hashes match, and if so short circuit the entire diff.Beta Was this translation helpful? Give feedback.
All reactions