jQuery .find() vs. context selector (v80)

Revision 80 of this benchmark created on


Description

comparing selector speed

Preparation HTML

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

<span>
    <div class="adding"></div>
</span>

Test runner

Ready to run.

Testing in
TestOps/sec
find method


alert($('span').find('div').hasClass('adding'));
ready
context method
alert($('span div').hasClass('adding'));
ready

Revisions

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