typecache

JavaScript performance comparison

Revision 3 of this test case created by

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
CacheHit
function demoInlineCacheHit() {
 var things = new Array(2);
 things[0] = {
  x: 0,
  y: 1,
  z: 3
 };
 things[1] = {
  x: 0,
  y: 1
 };
 var total = 0;
 for (var i = 0; i < 1000; i++) {
  total += things[i % 2].y;
 }
 return total;
}

demoInlineCacheHit();
pending…
CacheMiss
function demoInlineCacheMiss() {
 var things = new Array(2);
 things[0] = {
  x: 0,
  y: 1
 };
 things[1] = {
  y: 1,
  x: 0
 };
 var total = 0;
 for (var i = 0; i < 1000; i++) {
  total += things[i % 2].y;
 }
 return total;
}

demoInlineCacheMiss();
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.

0 Comments