selector test

JavaScript performance comparison

Test case created by David McFarland

Preparation code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="bob">
<a href="#">A</a>
<a href="#">B</a>
<a href="#">C</a>
<a href="#">D</a>
<a href="#">E</a>
</div>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
<p>other html here</p>
    

Preparation code output

<div id="bob"> <a href="#">A</a> <a href="#">B</a> <a href="#">C</a> <a href="#">D</a> <a href="#">E</a> </div> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p> <p>other html here</p>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
element test
$('a').css('color','red');
pending…
id test
$('#bob a').css('color','red');
pending…
find test
$('#bob').find('a').css('color','red');
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.

0 Comments

A B C D E

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here

other html here