jQuery selectors speed test (v9)

Revision 9 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');
$.find(.test2')
$.find(.test3')
$.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.