2 ms·
In my experience, Mutation Observers can be very punishing in terms of performance if you have large DOM structures, especially on page load. Mutation events a
by onion2k 6y ago
In my experience, Mutation Observers can be very punishing in terms of performance if you have large DOM structures, especially on page load.
Mutation events are what kills performance, not mutation observers.
- db48x 6y agoYes, though browsers have long been optimizing this by simply never processing mutation events unless the page has event handlers for them.
- roca 6y agoMutationObserver is much more efficient than mutation events because it can group events into batches, vastly reducing the number of event handler callbacks when you're observing whole documents.