Jquery vs Sizzle vs Vanilla (v2)

Revision 2 of this benchmark created on


Preparation HTML

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

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

<span></span>

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

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

Test runner

Ready to run.

Testing in
TestOps/sec
JQuery
var el = $("#test");
var el2 = $(".testClass");
var el3 = $("span");
 
ready
Sizzle
var sel = Sizzle("#test");
var sel2 = Sizzle(".testClass");
var sel3 = Sizzle("span");
ready
Vanilla
var vel = document.getElementById("test");
var vel2 = document.getElementsByClassName(".testClass");
var vel3 = document.getElementsByTagName("span");
ready

Revisions

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