[Proto-Scripty] Re: DOM building methods

2009-05-13 Thread RobG
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

[Proto-Scripty] Re: DOM building methods

2009-05-13 Thread Josh Powell
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

[Proto-Scripty] Re: DOM building methods

2009-05-13 Thread Romek Szwarc
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

[Proto-Scripty] Re: DOM building methods

2009-05-13 Thread 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

[Proto-Scripty] Re: DOM building methods

2009-05-13 Thread RobG
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

[Proto-Scripty] Re: DOM building methods

2009-05-13 Thread keemor
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

[Proto-Scripty] Re: DOM building methods

2009-05-13 Thread Иван Генчев
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 >