Re: Mutation events - slowness examples

Jonas Sicking wrote:
> On Wed, Jun 24, 2009 at 11:53 PM, Sean Hogan<shogun70@westnet.com.au> wrote:
>   
>> 95ms for 1024 events. That's less than 0.1ms per event, which is why I would
>> say irrelevant to user-experience.
>> How would you define "irrelevant to the user experience" and do you think
>> any alternative could do significantly better?
>>     
>
> 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.
>
> So to me it's the percentage-wise change that is interesting. Unless
> we have reason to believe that the whole operation happens rarely
> enough that performance in general just isn't an issue at all.
>
> / 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

Received on Friday, 26 June 2009 00:27:38 UTC