jquery selector speed

JavaScript performance comparison

Revision 28 of this test case created by Guhe Louis

Preparation code

<div>
<div class="repo">
<div class="div-cl">
<span class="span-cl-9999"></span>
</div>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.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
A
$('.repo .div-cl .span-cl-9999').css("border", "1px solid #000");
pending…
B
$('div.repo div.div-cl span.span-cl-9999').css("border", "1px solid #000");
pending…
C
$('div.repo div.div-cl span.span-cl-9999').css("border", "1px solid #000");
pending…
D
$('.repo .div-cl .span-cl-9999').css("border", "1px solid #000");
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