4 ms·
My understanding is that's CSS reflows what makes DOM operations expensive (plus maybe re-building redundant/cached DOM structures such as document.links and in
by tannhaeuser 7y ago
My understanding is that's CSS reflows what makes DOM operations expensive (plus maybe re-building redundant/cached DOM structures such as document.links and informing event listeners), rather than trivial tree insertions. You could also batch multiple DOM updates by just constructing an off-screen DOM element hierarchy and then finally attach it to the live DOM, replacing anything below a given node in a single atomic operation. AFAICS, DOM diffing really only adds value if you have DOM updates from many sources/components to merge for very complex React-like apps. Happy to be corrected by actual performance figures/experts.
- The_rationalist 7y agoMy understanding is that's CSS reflows what makes DOM operations expensive This is why CSS contain property is such a big performance revolution. There is also if I remember well, a special kind of Dom that is only for logic, therefore being unaffected to reflows. I don't remember how it's called.
- lioeters 7y agoYou're probably thinking of CSS position absolute or fixed, which are "outside the flow" and can be used (i.e., for animation) to minimize reflow.
- lootsauce 7y agoI believe you are speaking of a fragment. https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment https://developer.mozilla.org/en-US/docs/Web/API/DocumentFra...
- The_rationalist 7y agoExactly