Re: Mutation events - slowness examples

Sean Hogan wrote:
> Jonas Sicking wrote:
>>
>> I don't really have any data on how much attribute-setting performance
>> sensitive applications are doing, or will be doing in 5 years. So
>> while it's 0.1 ms per event, you have to multiply that by an unknown
>> number of events.
>>
>> / Jonas
>>   
>
> I don't know what would count as a performance sensitive web-app.
> I just went to gmail and ran this bookmarklet
>
> javascript: var evCount = { nodeInserted: 0, nodeRemoved: 0, 
> attrModified: 0 }; document.addEventListener("DOMNodeInserted", 
> function(e) { evCount.nodeInserted++ }, true); 
> document.addEventListener("DOMNodeRemoved", function(e) { 
> evCount.nodeRemoved++ }, true); 
> document.addEventListener("DOMAttrModified", function(e) { 
> evCount.attrModified++ }, true); window.setTimeout(function() { var 
> txt = ""; for (var p in evCount) { txt += p + ": " + evCount[p] + 
> "\n"; }; alert(txt); }, 60000); alert("Go");
>
> which counts DOMNodeInserted, DOMNodeRemoved, DOMAttrModified events 
> for a minute.
> I sent a couple of mails to myself and read them. Pushed a couple of 
> buttons, twiddled a couple of dials.
> After a minute it reported these counts:
> nodeInserted: 16
> nodeRemoved: 14
> attrModified: 453
>
>
I repeated this on google.com, just typing words or letters and seeing 
what was suggested - fairly continuous typing or deleting.
After a minute I got these results:
nodeInserted: 2420
nodeRemoved: 167
attrModified: 875

Total = 3462 events.


I also tried jQuery UI's dialog demo at http://jqueryui.com/demos/dialog/
Tried all the demos. Clicked on the tabs.
Results:
nodeInserted: 114
nodeRemoved: 102
attrModified: 516

Total = 732 events.


Google Reader
nodeInserted: 1096
nodeRemoved: 1068
attrModified: 215

Total = 2379 events

Received on Friday, 26 June 2009 03:05:26 UTC