cash vs dom

JavaScript performance comparison

Test case created by

Preparation code

<div class="grid">
 <div>1</div>
 <div>1</div>
 <div>1</div>
 <div>1</div>
 <div>1</div>
</div>
      
<script>
Benchmark.prototype.setup = function() {
  var grid = document.querySelector('.grid'), x, y, tmp = grid.children;

};
</script>

Preparation code output

<div class="grid"> <div>1</div> <div>1</div> <div>1</div> <div>1</div> <div>1</div> </div>

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
cashe
for (x = 0; x < 5; x ++) {
    tmp[x].firstChild.data = '8';
};
pending…
dom
for (x = 0; x < 5; x ++) {
    grid.children[x].firstChild.data = '9';
};
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

1
1
1
1
1