Creating Objects (v42)

Revision 42 of this benchmark created by crazy2be on


Preparation HTML

<script>
  Obj = function(p, foo) {
   this.p = p;
   this.foo = foo;
  };
  Obj.prototype.getFoo = function(){ return this.foo; };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Object.create() using in-place property object
o = new Obj(42, "CHT");
ready
Object.create() using pre-defined property object
o = {p: 42, foo: "CHT"}
ready

Revisions

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