Big selector v find() chain

Benchmark created by Doug Avery on


Preparation HTML

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

<div class="one">
  <div id="two">
    <div title="three">
      <div>
        Hello!
      </div>
    </div>
  </div>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Long selector
var $long = $('.one #two [title=three] div:visible');
ready
find() chain
var $find = $('.one').find('#two').find('[title=three]').find('div:visible');
ready

Revisions

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

  • Revision 1: published by Doug Avery on