effects of re-wrapping jQuery objects

JavaScript performance comparison

Test case created by davidThomas

Preparation code

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


<table>
  <thead>
    <tr>
      <th>Column One</th>
      <th>Column Two</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Row one, cell one</td>
      <td>Row one, cell two</td>
    </tr>
      <td>Row two, cell one</td>
      <td>Row two, cell two</td>
    </tr>
  </tbody>
</table>
    

Preparation code output

<table> <thead> <tr> <th>Column One</th> <th>Column Two</th> </tr> </thead> <tbody> <tr> <td>Row one, cell one</td> <td>Row one, cell two</td> </tr> <td>Row two, cell one</td> <td>Row two, cell two</td> </tr> </tbody> </table>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
jQuery object
var cell = $('tbody td').first();

cell.css('color','red');
pending…
re-wrapped jQuery
var cell = $('tbody td').first();

$(cell).css('color','red');
pending…

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

Compare results of other browsers

0 Comments

Column One Column Two
Row one, cell one Row one, cell two
Row two, cell one Row two, cell two