Re: Mutation events - slowness examples

François REMY wrote:
> There's cleary two factors that apply :
> ==> Time needed to move from managed C++ to unmanaged JScript
> ==> Time of JScript execution

You missed a third one: DOM event dispatch per se.

For example, on your test2, I see the following in a current trunk 
Firefox build:

10% of total time spent creating DOM nodes from the string.
40% of total time spent handling the insert internally
    (creating the layout objects, etc).
45% of total time spent firing and handling the DOM event.

That last 45% breaks down as follows (all percentages are of total 
testcase time):

   10% building up the event target chain and doing pre- and
       post-dispatch handling of various sorts.
    6% traversing that chain.
    5% looking for listeners for this event on the various targets in
       the chain.
    6% setting up the right security context for the event dispatch.
    8% creating the necessary JS objects (I have no idea why this takes
       so long).
    8% making the actual call into JS.

Note that about half the "event dispatch time" is used even if there is 
no listener to dispatch to (though if there is really no listener we 
optimize away the mutation event dispatch altogether)...

-Boris

Received on Saturday, 6 June 2009 19:17:06 UTC