new vs Object.create (v5)

Revision 5 of this benchmark created on


Description

Prototype properties are now prototype's and object's properties are object's in both cases.

Preparation HTML

<script>
  var C1 = {
    sayA: function() {},
    sayB: function() {},
    C1: function(x) {
      this.a = x
      this.b = {};
      this.c = [];
    }
  };
  
  var C2 = function(x) {
      this.a = x;
      this.b = {};
      this.c = [];
      }
      
      
      
  C2.prototype.sayA = function() {};
  C2.prototype.sayB = function() {};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Create
var object = Object.create(C1);
object.C1(Math.random());
ready
New
var object = new C2(Math.random());
ready

Revisions

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