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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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 (u64fnv hash of the wholeTokenStreamwould be the most naive), and then attach it at the rootVTagof the<h1>(VTagis already boxed, so another field there shouldn't make much of a difference).On runtime the
PartialEqcould 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