jQuery selectors speed test (v10)

Revision 10 of this benchmark created on


Description

jQuery selectors speed test $ over .find

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id='test'>
<div id='test2'></div>
<div id='test3'></div>
<div id='test4'></div>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
click
var id = 'test';
$('#'+id+' .test2');
$('#'+id+' .test3');
$('#'+id+' .test4');
ready
on
var id = 'test'
var el = $('#'+id');
el.find(.test2');
el.find(.test3');
el.find(.test4');
 
ready
on document
 
ready

Revisions

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