domManip tribulations

JavaScript performance comparison

Test case created by Dan Heberden

Preparation code

<script src="http://dl.dropbox.com/u/3531958/jquery-dists/jquery-7992.js"></script>
<script>
    var $rw = jQuery.noConflict();
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>
    var $14 = jQuery.noConflict();
</script>
<script src="http://code.jquery.com/jquery-1.5b1.js"></script>
<script>
    var $15 = jQuery;
</script>


<div id="jq144" style="display:none;"></div>
<div id="jq150" style="display:none;" ></div>
<div id="jq150rw" style="display:none;" ></div>
<script>
  var thismany = 500,
      $divs = $(false),
      containers = ["jq144", "jq150", "jq150rw"];
  
  while (thismany--) {
   $divs.push($('<div/>')[0]);
  }
  
  for (var i = 0; i < containers.length; i++) {
   $("#" + containers[i]).append($divs.clone());
  }
</script>
    

Preparation code output

<div id="jq144" style="display:none;"></div> <div id="jq150" style="display:none;" ></div> <div id="jq150rw" style="display:none;" ></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
jQuery 1.4.4 domManip
$14('#jq144').children().domManip('foo', true, function() {});
pending…
jQuery 1.5b domManip
$15('#jq150').children().domManip('foo', true, function() {});
pending…
jQuery 1.5rw domManip
$rw('#jq150rw').children().domManip('foo', true, function() {});
pending…
jQuery 1.4.4 append
$14('#jq144').children().append('foo');
pending…
jQuery 1.5b append
$15('#jq150').children().append('foo');
pending…
jQuery 1.5rw append
$rw('#jq150rw').children().append('foo');
pending…
jQuery 1.4.4 after
$14('#jq144').children().after('foo');
pending…
jQuery 1.5b after
$15('#jq150').children().after('foo');
pending…
jQuery 1.5rw after
$rw('#jq150rw').children().after('foo');
pending…
jQuery 1.4.4 clone
$14('#jq144').children().clone();
pending…
jQuery 1.5b clone
$15('#jq150').children().clone();
pending…
jQuery 1.5rw clone
$rw('#jq150rw').children().clone();
pending…

Compare results of other browsers

Revisions

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

0 Comments