Object.create() vs. constructor vs. object literal (v83)

Revision 83 of this benchmark created by yangqing on


Preparation HTML

<script>
  var Obj = function(p) {
   this.p = p;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Constructor function
o = new Obj(1);
ready
Object.create() using in-place prototype object
o = {p: 1};
ready

Revisions

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