Object.create() vs. __proto__

Benchmark created on


Preparation HTML

<script>
  var m = {a: 42, b: 7};
  var props = {b: {value: 17}, c: {value: 11}};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
__proto__
for (var i = 0; i < 1000; i++) {
  var a = {};
  a.__proto__ = m;
  a.b = 17;
  a.c = 11;
}
ready
Object.create()
for (var i = 0; i < 1000; i++) {
  var a = Object.create(m, props);
}
ready

Revisions

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