jQuery .find() vs. context selector vs non-context selector (v144)

Revision 144 of this benchmark created by Damon on


Preparation HTML

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

<article>
  <ins></ins>
  <ins></ins>
  <ins></ins>
  <ins></ins>
  <ins></ins>
</article>

Test runner

Ready to run.

Testing in
TestOps/sec
'parent > child' selector
$('article > ins').each(function(index){
  $(this).attr("data-index", index);
});
ready
children
$('article').children('ins').each(function(index){
  $(this).attr("data-index", index);
});
ready

Revisions

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