Actually, the DOM is not slow. Adding or removing a DOM node is not much more than setting a property on the JS object. However, layout is slow. Imagine adding a DOM node changes the height of the document, it would invoke a bunch of rendering processes to redraw the screen. And all the complex algorithms behind the those processes makes any changes in DOM potentially expensive.
Why DOM manipulation is slow?
tags: javascript, dom, frontend
Why DOM manipulation is slow?
Mentioned in

Subscribe to Dwarves Memo
Receive the latest updates directly to your inbox.