new vs Object.create
JavaScript performance comparison
Preparation code
<script>
var Klass = function() {};
Klass.prototype.a = function() {};
Klass.prototype.b = function() {};
Klass.prototype.c = function() {};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
new |
|
pending… |
Object.create |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Jeremy Ashkenas
- Revision 4: published by New vs create with ctors
- Revision 5: published
- Revision 6: published
- Revision 8: published
- Revision 9: published
- Revision 10: published
0 comments