performance frozen object (v18)

Revision 18 of this benchmark created on


Setup

a1 = [];
    a2 = [];
    
    for (i = 0; i < 1000; i++) {
    
      var o1 = {
        x: "vx",
        y: "vy"
      };
      var o2 = {
        x: "vx",
        y: "vy"
      };
    
      Object.freeze(o2);
    
      a1.push(o1);
      a2.push(o2);
    }
    
    Object.freeze(a2);

Test runner

Ready to run.

Testing in
TestOps/sec
non-frozen
var x = null;
var y = null;

for (i = 0; i < 1000; i++) {
  x = a1[i].x;
  y = a1[i].y;
}
ready
frozen
var x = null;
var y = null;

for (i = 0; i < 1000; i++) {
  x = a2[i].x;
  y = a2[i].y;
}
ready

Revisions

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