doc frag - jquery vs js

JavaScript performance comparison

Test case created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<nav style="position: absolute; height: 0; width: 0;"></nav>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
jquery
var ul = $.buildFragment( ['<div></div>'], document);

for(var i = 0; i < 100; i++) {
  ul.appendChild($('<div></div>')[0]);
}
pending…
js
var frag = document.createDocumentFragment(),
    ul = $('<div></div>');

for(var i = 0; i < 100; i++) {
  frag.appendChild($('<div></div>')[0]);
}
pending…

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

Compare results of other browsers

0 comments

Add a comment