literal vs new (objects)
JavaScript performance comparison
Preparation code
<script>
var o;
if (!Object.create) {
Object.create = function(o) {
var f = function() {};
f.prototype = o;
return new f;
}
}
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
Test | Ops/sec | |
---|---|---|
new
|
|
pending… |
literal
|
|
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.
- Revision 1: published
- Revision 2: published Alexander Makarenko
- Revision 4: published
- Revision 5: published
- Revision 6: published Test
- Revision 7: published
- Revision 8: published
- Revision 9: published Nathan
- Revision 10: published
- Revision 11: published
- Revision 12: published
- Revision 13: published Nārāyaṇa
- Revision 14: published Nārāyaṇa
- Revision 15: published Nārāyaṇa
0 Comments