jQuery Key Selector Test

Benchmark created by wwwyzzerdd on


Preparation HTML

<div id="my-div">
  <a href class="mylink">foo</a>
  <a href class="mylink">foo</a>
  <a href class="mylink">foo</a>
  <a href class="mylink">foo</a>
  <a href class="mylink">foo</a>
  <a href class="mylink">foo</a>
  <a href class="mylink">foo</a>
  <a href class="mylink">foo</a>
  <a href class="mylink">foo</a>
  <a href class="mylink">foo</a>
</div>
<a href>foo</a>
<a href>foo</a>
<a href>foo</a>
<a href>foo</a>
<a href>foo</a>
<a href class="mylink">foo</a>
<a href class="mylink">foo</a>
<a href class="mylink">foo</a>
<a href class="mylink">foo</a>
<a href class="mylink">foo</a>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
id + tag name
$(function () {
  var foo = $('#my-div a')
});
ready
class name only
$(function () {
  var foo = $('.my-link')
});
ready

Revisions

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