jQuery Cached Set

JavaScript performance comparison

Revision 24 of this test case created

Info

Compare performance of cached vs repeated element selections

Preparation code

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>

<table id="rankTable" style="word-break: break-all; min-width: 956px; width: 250px;">
  <tr class="trRank"><td>a</td></tr>
  <tr class="trRank"><td>b</td></tr>
  <tr class="trRank"><td>c</td></tr>
  <tr class="trRank"><td>d</td></tr>
  <tr class="trRank"><td>e</td></tr>
        </table>
<script>
</script>

Preparation code output

a
b
c
d
e

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Cached elements
$('.trRank').append('abv');

//var tbody = $('#rankTable tbody');
pending…
No cache
$('.trRank').append('<td></td>').text("label");
 
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment