Does #id el find all els first? (v8)

Revision 8 of this benchmark created by Lars on


Description

Making the HTML tree more representative of cases where performance would matter, i.e. where there are more elements of the selected type, especially outside of the #id element.

Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
#id el
$('#id span')
ready
el unrestricted
$('span')
ready
find
$("#id").find("span")
ready
context
$("span", "#id")
ready

Revisions

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