Simple Object.create() performance test (v85)

Revision 85 of this benchmark created by amit on


Preparation HTML

<script>
  function _P() {
   this.p = 1;
  };

  function object(o) {
      function F() {}
      F.prototype = o;
      return new F();
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Object.create
var withoutNew  = Object.create(Object.prototype, {
 p: {
  value: 1
 }
});
ready
With New
var withNew = new function(){this.p=1;}()
ready
With New
var with_new = new _P();
ready
With New:Crockford
o = object({p: 1});
ready
Without New
var fastest = {"p":1};
 
ready

Revisions

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