E.J. BLOG

Archive for July, 2013

[Javascript] performance issues when appending in DOM tree

leave a comment

Image Credit

According to John Resig’s blog, you can see that there is 2x-3x performance better when using fragments.

Take his code for example :

If you use original append to append divs one by one, then you will see the blink on the screen especially when you are going to append a huge list. But, when using fragments, it is another kind of structure to hold these temporary divs and will be appended to the target all together at the same time.

So if one day you have to deal with massive DOM manipulation problems without 3rd party libraries’ help, remember to use it.

Cheeers 😛

Read More on : http://ejohn.org/blog/dom-documentfragments/

Written by EragonJ

July 30th, 2013 at 4:56 pm

Posted in Javascript

Tagged with , , ,