some jquery selectors performance tests

JavaScript performance comparison

Revision 31 of this test case created

Preparation code

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

<div id="a">
<div>
<div type='search2'>    
<div type='search1'>  
<p type='search2'>
</p>
<p>
</p>
</div>    
</div>
</div>    
</div>

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
$('div[type=search1]')
$('div[type=search1]')
pending…
$('div[type=search2] div[type=search1]')
$('div[type=search2] div[type=search1]')
pending…
$('p')
$('p')
pending…
document.querySelectorAll('div[type=search1]');
document.querySelectorAll('div[type=search1]');
pending…
document.querySelectorAll('div[type=search2] div[type=search1]');
document.querySelectorAll('div[type=search2] div[type=search1]');
pending…
document.querySelectorAll('p');
document.querySelectorAll('p');
pending…
$(document.querySelectorAll('div[type=search1]'));
$(document.querySelectorAll('div[type=search1]'));
pending…
$(document.querySelectorAll('div[type=search2] div[type=search1]'));
$(document.querySelectorAll('div[type=search2] div[type=search1]'));
pending…
$(document.querySelectorAll('p'));
$(document.querySelectorAll('p'));
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