You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a node's dirty flag propagates to the root of the tree ensuring that when any node is invalidated its whole subtree will be re-calculated. This is often times not needed. There are many properties which only effects a node's children and would not need to propagate all the way to the root such as align-items. Also in cases where the style does change layout it may not need to propagate all the way to the root but can often stop at the nearest position: absolute parent.
This change has the potential of greatly improving performance of re-calculating a tree.
This might require adding a second dirty flag named hasDirtyChildren ensuring that traversal still works even though a parent is not marked as dirty.
The text was updated successfully, but these errors were encountered:
I've worked on something similar for mylittledom; at first I tried to only traverse children that were marked as dirty, but the issue was that a dirty node would possibly not only affect its children, but also its siblings (except when absolutely positioned, but it's often not the case, so the optimization would not affect the hot path and would probably make it slower). The algorithm I went with is to always cascade the layout on both dirty nodes and on any children of a node that has at least one dirty children, but to stop the cascading if such a node (which isn't explicitely marked as dirty) does not change its layout.
Currently a node's dirty flag propagates to the root of the tree ensuring that when any node is invalidated its whole subtree will be re-calculated. This is often times not needed. There are many properties which only effects a node's children and would not need to propagate all the way to the root such as
align-items
. Also in cases where the style does change layout it may not need to propagate all the way to the root but can often stop at the nearestposition: absolute
parent.This change has the potential of greatly improving performance of re-calculating a tree.
This might require adding a second dirty flag named
hasDirtyChildren
ensuring that traversal still works even though a parent is not marked as dirty.The text was updated successfully, but these errors were encountered: