jQuery multiple find

Benchmark created by Jacky on


Description

check if multiple find is faster

Preparation HTML

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

<table id="test">
    <tr><td>abc</td><td>def</td><td>ghi</td></tr>
    <tr><td>abc</td><td>def</td><td>ghi</td></tr>    
    <tr class="row"><td>abc</td><td class="def">def</td><td>ghi</td></tr>
    <tr class="row"><td>abc</td><td class="def">def</td><td>ghi</td></tr>
    <tr><td>abc</td><td>def</td><td>ghi</td></tr>
    <tr><td>abc</td><td>def</td><td>ghi</td></tr>
    <tr class="row"><td>abc</td><td class="def">def</td><td>ghi</td></tr>
    <tr class="row"><td>abc</td><td class="def">def</td><td>ghi</td></tr>
    <tr class="row"><td>abc</td><td class="def">def</td><td>ghi</td></tr>
    <tr><td>abc</td><td>def</td><td>ghi</td></tr>
</table>
<script>
  var t = $("#test")
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
direct find
t.find("td.def")
ready
indirect find
t.find("tr.row").find("td.def")
ready
indirect query
t.find("tr.row td.def")
ready

Revisions

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