jQuery find vs context selector (v6)

Revision 6 of this benchmark created on


Preparation HTML

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

<div id="test1">
<dl>
<dt>Hi</dt>
<dd>There</dd>
</dl>
</div>

<div class="test2">
<dl><dt>Hi</dt>
<dd>There</dd>
</dl>
</div>

<div id="test3">
<dl>
<dt class="test3a">Hi</dt>
<dd class="test3b">There</dd></dl>
</div>

<div class="test4">
<dl>
<dt class="test4a">Hi</dt>
<dd class="test4b">There</dd>
</dl>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
find (subset of id)
$("div#test1")
ready
context (subset of id)
$("#test1");
ready
find (subset of class)
ready
context (subset of class)
ready
find class (subset of id)
ready
context class (subset of id)
ready
find class (subset of class)
ready
context class (subset of class)
ready

Revisions

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