Append Array of jQuery Elements

JavaScript performance comparison

Test case created by Peter

Preparation code

<div id="test"></div>
<script src=""></script>

Benchmark.prototype.setup = function() {
  var $elts = [];
  for (var i=0; i<100; i++) {
      $elts.push($('<span>', {text: i}));
  var $test = $('#test');


Benchmark.prototype.teardown = function() {
  $elts = null;


Preparation code output

<div id="test"></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
Append in each
$.each($elts, function(i, $elt) {
Convert to list of DOM elements and append
var elts = $.map($elts, function($elt) {
    return $elt.get();
Append list of jQuery elements

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

Compare results of other browsers