DEV Community

Discussion on: Javascript DOM Manipulation to improve performance

Collapse
 
yhorobey profile image
yhorobey • Edited

Newdays DOM is smart enough to not launch reflow after each DOM change.
The trick is "do not ask DOM for values which are not available without reflow".

For example:
You have some container, div, you add to it a couple of other elements and after each addition you ask DOM "what is height of the parent div". Most likelly this will cause a reflow and this is very costly operation.