Faster Jquery Append

JavaScript performance comparison

Test case created by Chris

Preparation code

<script src=""></script>
<div class="element"></div>

Preparation code output

<div class="element"></div>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Direct append
for(var i = 0; i < 10; i++)
   $(".element").append( $('<div></div>') );
Indirect append
var $temp = $('<div></div>'); 
for(var i = 0; i< 10; i++) 
   $temp.append( $('<div></div>') );
$(".element").append( $temp.children() );

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers