Re: Mutation events - slowness examples

Sean Hogan wrote:
> It's only huge if it noticeably affects the UX. 

Yes.

> This example arguably proves that it does not: 1024 DOMNodeInserted events and it's only just on the threshold of user awareness - 100ms.

Again, for a very shallow DOM.

> And this test doesn't even include the time for rendering - I've done some primitive testing and for a smaller number of inserted nodes (say 100) the rendering takes longer than the event dispatch.

This will strongly depend on the DOM, the exact sequence of calls used 
to construct it, etc.

For myself, the performance problems I've seen that Jonas' proposal is 
trying to address are more common with attribute modification than node 
insertion/removal...

> Agreed. I guess by current spec I mean using DOM Events as opposed to some new handling scheme. But couldn't we just change the spec so that Mutation Events are asynchronous? Is anyone relying on them being synchronous?

I believe so, yes.

> In fact, my testing indicates there is no time difference between "DOMNodeInserted listener not on parent chain" and no DOMNodeInserted listener. Do you have examples that demonstrate otherwise? 

You'd need a pretty deep DOM and a bunch of modifications that are very 
cheap in and of themselves (this test, which does a whole bunch of work 
for the one modification it makes, is not a good example).

But even then, the overhead is pretty low for this case.  We try hard to 
make it so.  ;)

-Boris

Received on Sunday, 7 June 2009 13:25:00 UTC