yet another jQuery selector test

Benchmark created by Scott Kosman on


Description

Some more benchmarking tests based on comments at my jQuery Performance article at 24ways.org

http://24ways.org/2011/your-jquery-now-with-less-suck

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<section>
  <div id="content">
    <p>
      foo
    </p>
  </div>
</section>

Test runner

Ready to run.

Testing in
TestOps/sec
multi-element
$('body > section div#content p');
ready
fewer elements in selector
$('#content p');
ready
complex .find()
$('body > section div#content').find("p");
ready
simplified .find()
$('#content').find("p");
ready

Revisions

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

  • Revision 1: published by Scott Kosman on