performance frozen object (v21)

Revision 21 of this benchmark created by d on


Setup

var f1 = function() {};
    var f2 = function() {};
    var f3 = function() {};
    
    f1.prototype.test = function(arg) {
      this.doWork = arg;
    }
    f2.prototype.test = function(arg) {
      this.doWork = arg;
    }
    f3.prototype.test = function(arg) {
      this.doWork = arg;
    }
    
    Object.freeze(f2.prototype);
    Object.seal(f3.prototype);
    
    var o1 = new f1();
    var o2 = new f2();
    var o3 = new f3();

Test runner

Ready to run.

Testing in
TestOps/sec
non-frozen object
o1.test(Math.random());
ready
frozen object
o2.test(Math.random());
ready
sealed prototype
o3.test(Math.random());
ready

Revisions

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