Jquery vs Sizzle vs Vanilla

JavaScript performance comparison

Test case created

Preparation code

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

<div class="testClass"></div>

<span></span>

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

<script src="https://raw.github.com/jquery/sizzle/master/dist/sizzle.min.js"></script>

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 el = $("#test");
var el2 = $(".testClass");
var el3 = $("span");
 
pending…
Sizzle
var sel = Sizzle("#test");
var sel2 = Sizzle(".testClass");
var sel3 = Sizzle("span");
pending…
Vanilla
var vel = document.getElementById("test");
var vel2 = document.getElementsByClassName(".testClass");
var vel3 = document.getElementsByTagName("span");
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