jQuery performance versus DOM performance

JavaScript performance comparison

Test case created by

Preparation code

<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>

<div id="output"></div>
      
<script>
Benchmark.prototype.setup = function() {
  var output = document.querySelector('#output');

};

Benchmark.prototype.teardown = function() {
  document.querySelector('#output').innerHTML = '';

};
</script>

Preparation code output

<div id="output"></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
Native DOM management
var e = document.createElement('div');
var t = document.createTextNode('Test');
e.appendChild(t);
output.appendChild(e);
pending…
jQuery DOM management
var e = $('<div/>');
e.text('Test').appendTo('#output');
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