Object.create() vs. constructor vs. object literal (v91)

Revision 91 of this benchmark created on


Preparation HTML

<script>
function Obj() {
}
  
ObjProto = Obj.prototype = {
    method1: function () { },
    method2: function () { },
    method3: function () { },
    method4: function () { },
    method5: function () { },
    method6: function () { },
    method7: function () { },
    method8: function () { },
    method9: function () { },
    method10: function () { }
};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Object.create()
o = Object.create(ObjProto);
ready
Constructor function
o = new Obj();
ready

Revisions

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