On May 13, 11:49 pm, "T.J. Crowder" wrote:
> Hi,
>
> > As you can see third method is 4 times faster than first one.
>
> Yes. The third method largely evaluates to setting the innerHTML
> property of the list element, which uses the browser's built-in HTML
> processing. Reading HTML strings a
It's a very common development pattern/problem that comes up.
Creating a bunch of repetitive DOM elements and inserting them into
the page.
It comes down to:
1) Native for loops will always be faster then calling a function
that then does the loop
2) Native inserts are faster then library inser
Thanks T.J. for this long answer.
Maybe not many people will face such a performance problem, but this could
be written in documentation, so we can avoid such issues at the beginning.
This could be also good topic for PimpMyCode series at Prototype's blog.
Greetings
Romek
2009/5/13 T.J. Crowder
Hi,
> As you can see third method is 4 times faster than first one.
Yes. The third method largely evaluates to setting the innerHTML
property of the list element, which uses the browser's built-in HTML
processing. Reading HTML strings and quickly turning those into the
displayed result is fund
On May 13, 6:12 pm, keemor wrote:
> Hi,
>
> I'd like to present 3 ways of building ul list and compare the speed
> of them.
> I used firebug's profiler on FF3
>
> html:
>
> go
>
>
> $('go').observe('click',go);
>
[...]
> Third:
> Time to build (513.747ms, 30054 wywołań)
> fun
Use Profile from firebug manually or :
console.profile([title]) & console.profileEnd()
http://getfirebug.com/console.html
On May 13, 12:32 pm, Иван Генчев wrote:
> Hi, how did you collect timing data? I use FF3.5b4 with it's JIT
> JavaScript engine an I would like to see how it will change thi
Hi, how did you collect timing data? I use FF3.5b4 with it's JIT
JavaScript engine an I would like to see how it will change things for
all three methods.
keemor wrote:
> Hi,
>
> I'd like to present 3 ways of building ul list and compare the speed
> of them.
> I used firebug's profiler on FF3
>