literal-vs-object-create

Benchmark created by Oleg Aleynik on


Setup

function Point(x, y) {
      this.x = x;
      this.y = y;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Literal
var obj = {
  x: 10,
  y: 10
};
return obj;
ready
Object.create
var obj = Object.create(null);
return obj;
ready
new Point
var obj = new Point(10, 10);
return obj;
ready

Revisions

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

  • Revision 1: published by Oleg Aleynik on