for fun

JavaScript performance comparison

Test case created

Preparation code

<table>
<tr>
 <td>0</td>
 <td>0</td>
 <td>0</td>
</tr>
<tr>
 <td>0</td>
 <td>0</td>
 <td>0</td>
</tr>
<tr>
 <td>0</td>
 <td>0</td>
 <td>0</td>
</tr>
</table>
<script>
Benchmark.prototype.setup = function() {
    var table = document.querySelector('table'), i, j, row;
};
</script>

Preparation code output

0 0 0
0 0 0
0 0 0

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
for
for (j = 0; j < 3; j ++) {
    row = table.rows[j].cells;
    for (i = 0; i < 3; i ++) {
        row[i].firstChild.data = i;
    };
};
pending…
none
table.style.display = 'none';
for (j = 0; j < 3; j ++) {
    row = table.rows[j].cells;
    for (i = 0; i < 3; i ++) {
        row[i].firstChild.data = i;
    };
};
table.style.display = 'table';
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

Add a comment