Here's what the profiler looks like for a 200ms period in Firefox, for example. I see 200-ish calls of setTimeout and associated callbacks during this period.
According to MDN:
The mutation events have been marked as deprecated in the DOM Events specification, as the API's design is flawed (see details in the "DOM Mutation Events Replacement: The Story So Far / Existing Points of Consensus" post to public-webapps).
Mutation Observers are the proposed replacement for mutation events in DOM4. They are expected to be included in Firefox 14 and Chrome 18.
The practical reasons to avoid the mutation events are performance issues and cross-browser support.
And to the point most directly:
Adding DOM mutation listeners to a document profoundly degrades the performance of further DOM modifications to that document (making them 1.5 - 7 times slower!). Moreover, removing the listeners does not reverse the damage.
The performance effect is limited to the documents that have the mutation event listeners.
source
At my company, we are seeing some crazy perf problems in non-webkit browsers that emanate from nicescroll's listening for deprecated mutation events.
Here's what the profiler looks like for a 200ms period in Firefox, for example. I see 200-ish calls of
setTimeout
and associated callbacks during this period.According to MDN:
And to the point most directly: