Table Rows Selection (v4)

Revision 4 of this benchmark created on


Preparation HTML

<table id="tableId" class="tableClass">
<thead>
  <tr>
    <th>Column 1</th>
    <th>Column 2</th>
    <th>Column 3</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>a</td>
    <td>b</td>
    <td>c</td>
  </tr>
  <tr>
    <td>d</td>
    <td>e</td>
    <td>f</td>
  </tr>
  <tr>
    <td>g</td>
    <td>h</td>
    <td>i</td>
  </tr>
  <tr>
    <td>j</td>
    <td>k</td>
    <td>l</td>
  </tr>
</tbody>
<tfoot>
  <tr><td colspan="3"></td></tr>
  <tr><td colspan="3"></td></tr>
</tfoot>
</table>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Selector class with context
(function() {
 var rows = $('.tableClass tr');
}());
ready
Selector id with context
(function() {
 var rows = $('#tableId tr');
}());
ready
Selector class with find
(function() {
 var rows = $('.tableClass').find('tr');
}());
ready
Selector id with find
(function() {
 var rows = $('#tableId').find('tr');
}());
ready
Tag selector with class context
(function() {
 var rows = $('tr', '.tableClass');
}());
ready
Tag selector with id context
(function() {
 var rows = $('tr', '#tableId');
}());
ready
Selector id with context and child selector
(function() {
 var rows = $('#tableId > tr');
}());
ready

Revisions

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