Making jQuery.empty over 10x faster

Making jQuery.empty over 10x faster

Hi all,
I've just blogged about a technique that I used to make jQuery.empty
over 10x faster in some cases. Basically, rather than individually
removing each child element from the DOM which causes the browser to
reflow after each one, I use a shallow cloneNode to do the job then
copying events back over. Check out the blog post for more details:
http://devongovett.wordpress.com/2009/12/12/how-to-make-jquery-empty-over-10x-faster/.
I've included some charts comparing the performance of jQuery 1.4's
empty and html("") functions, as well as the function I've written,
and the cloneNode method out performs all other methods by a
significant amount in all browsers.
Thanks for jQuery!
Devon
--