Re: nsGenericElement::InsertBefore performance

Andreas Pflug <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Boris Zbarsky wrote:
> Andreas Pflug wrote:
>   
>> Initialisation will still be several magnitudes faster, since all 
>> controls will use their readily compiled handlers.
>>     
>
> Of course XBL also uses precompiled handlers...  The real issue here is not the 
> handlers.
>
>   
>> I see the problem that XUL/XBL is used as if it was as cheap as it is 
>> with typical gui lib
>>     
>
> Putting 8 images in a dialog is cheap with a typical GUI lib?
>   
Yes. You'd certainly have a prerequisite preparation of loading the 
image into some useful memory structure, easily cacheable, but the act 
of adding it to the windows list is a very cheap step. The windowing 
system doesn't need to resolve how to display the item at that moment, 
instead it is given a pointer to the function that will handle it.
Actually, I tested cal-mon-day-item with most images removed, and didn't 
find a noticeable difference, images are the cheap part.
>   
>> but using typical programming 
>> techniques will lead to poor results (unfortunately demonstrated by 
>> Sunbird/Lightning, which appears as some kind of Mozilla demo app to me 
>> since it's integrated into the mozilla source tree).
>>     
>
> Uh... That's a really really bad assumption.  _Really_ bad.
>
> My basic point was that the code involved is just poorly written if one is at 
> all interested in performance.
>   
So you believe nicely written code would be 100 times faster?
>
>
> You just described the XUL prototype system.  Which XBL uses, in fact, when 
> cloning the subtree, if the subtree is XUL.
>
>   
>> Easy, no? ;-)
>>     
>
> Not easy, but done!  ;)
>   
So if stuff is reused, why does it take 20k memory and 5ms to create a 
simple reference?

> See above.  Cloning XUL produces lightweight XUL elements that point to the 
> prototype element...  It's already optimized for exactly this use case.
>   
I must be missing something. Producing 22 lightweight XUL elements takes 
5 ms?
Refererencing your old mail, you found a lot of time is spent in the 
constructor, why is it re-executed? Why is "loading the XBL bindings" 
re-executed?

Regards,
Andreas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.