Creating Objects

JavaScript performance comparison

Revision 42 of this test case created by crazy2be

Preparation code

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

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

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

Compare results of other browsers


You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:


Add a comment