new vs Object.create

Benchmark created by Jeremy Ashkenas on


Preparation HTML

<script>
  var Klass = function() {};
  
  Klass.prototype.a = function() {};
  Klass.prototype.b = function() {};
  Klass.prototype.c = function() {};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
new
var object = new Klass();
ready
Object.create
var object = Object.create(Klass.prototype);
ready

Revisions

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