jQuery find child by class (v6)

Revision 6 of this benchmark created on


Description

Compare find by different methods

Preparation HTML

<script src="http://code.jquery.com/jquery-1.3.2.min.js"></script>

<table id="test">
<tr><td>abc</td><td class="def">def</td><td>ghi</td><td>jkl</td></tr>
<tr><td>abc</td><td>def</td><td>ghi</td><td>jkl</td></tr>
<tr><td>abc</td><td>def</td><td>ghi</td><td>jkl</td></tr>
<tr><td>abc</td><td class="def">def</td><td>ghi</td><td>jkl</td></tr>
<tr><td>abc</td><td class="def">def</td><td>ghi</td><td>jkl</td></tr>
<tr><td>abc</td><td>def</td><td>ghi</td><td>jkl</td></tr>
<tr><td>abc</td><td>def</td><td>ghi</td><td>jkl</td></tr>
<tr><td>abc</td><td class="def">def</td><td>ghi</td><td>jkl</td></tr>
<tr><td>abc</td><td class="def">def</td><td>ghi</td><td>jkl</td></tr>
<tr><td>abc</td><td>def</td><td>ghi</td><td>jkl</td></tr>
</table>

Test runner

Ready to run.

Testing in
TestOps/sec
pure query
$("#test td.def");
ready
find
$("#test").find("td.def");
ready
by context
$("td.def", document.getElementById("test"));
ready

Revisions

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