Creating Objects

JavaScript performance comparison

Revision 42 of this test case created by crazy2be

Preparation code

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

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");
pending…
Object.create() using pre-defined property object
o = {p: 42, foo: "CHT"}
pending…

Compare results of other browsers

Revisions

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:

0 comments

Add a comment