sigle selector vs find

Benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<div class="div1">
<span></span>
<span></span>
<span class="active"></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
selector
$('.div1 active').addClass('hello',true)
ready
find
$('.div1').find('active').addClass('hello',true)
ready

Revisions

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