jquery is awesome

JavaScript performance comparison

Revision 2 of this test case created by Christian Stone

Preparation code

<div id="Stupid_Div">
  Stupid Crap
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Preparation code output

Stupid Crap

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
$("#Stupid_Div").append("<div id='test1'></div>")
$("#Stupid_Div").append("<div id='test2'></div>")
$("#Stupid_Div").append("<div id='test3'></div>")
$("#Stupid_Div").append("<div id='test4'></div>")
pending…
Vanilla JS
var x=document.getElementById('Stupid_Div');
child=document.createElement("div");
child.id='test1';
x.appendChild(child);
child=document.createElement("div");
child.id='test2';
x.appendChild(child);
child=document.createElement("div");
child.id='test3';
x.appendChild(child);
child=document.createElement("div");
child.id='test4';
x.appendChild(child);
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. Here’s a list of current revisions for this page:

0 comments

Add a comment