Creating Objects (v44)

Revision 44 of this benchmark created by Quentin Brooks on


Preparation HTML

<script>
  Vector = function(x, y, w, h) {
    this.x = x;
    this.y = y;

    this.w = w;
    this.h = h;
  };
  Vector.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 Vector(5, 2, 8, 2);
ready
Object.create() using pre-defined property object
o = {x: 5, y:2, w:8, h:2}
ready

Revisions

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