jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
To see how much performance loss happens from prototype chaining
var lib = {};
lib.base = function () { };
lib.base.prototype.foo = function ()
{
}
lib.base.prototype.bar = function ()
{
}
lib.Test1 = function () { };
lib.Test1.prototype = new lib.base();
lib.Test1.constructor = lib.Test1;
lib.Test1.prototype.foo = function ()
{
this.bar();
}
lib.Test2 = function () { };
lib.Test2.prototype = new lib.Test1();
lib.Test2.constructor = lib.Test2;
lib.Test2.prototype.foo = function ()
{
this.bar();
}
lib.Test3 = function () { };
lib.Test3.prototype = new lib.Test2();
lib.Test3.constructor = lib.Test3;
lib.Test3.prototype.foo = function ()
{
this.bar();
}
lib.Test4 = function () { };
lib.Test4.prototype = new lib.Test3();
lib.Test4.constructor = lib.Test4;
lib.Test4.prototype.foo = function ()
{
this.bar();
}
lib.Test5 = function () { };
lib.Test5.prototype = new lib.Test4();
lib.Test5.constructor = lib.Test5;
lib.Test5.prototype.foo = function ()
{
this.bar();
}
lib.Test6 = function () { };
lib.Test6.prototype = new lib.Test5();
lib.Test6.constructor = lib.Test6;
lib.Test6.prototype.foo = function ()
{
this.bar();
}
lib.Test7 = function () { };
lib.Test7.prototype = new lib.Test6();
lib.Test7.constructor = lib.Test7;
lib.Test7.prototype.foo = function ()
{
this.bar();
}
lib.Test8 = function () { };
lib.Test8.prototype = new lib.Test7();
lib.Test8.constructor = lib.Test8;
lib.Test8.prototype.foo = function ()
{
this.bar();
}
lib.vars = {};
lib.vars.base = new lib.base();
lib.vars.Test1 = new lib.Test1();
lib.vars.Test2 = new lib.Test2();
lib.vars.Test3 = new lib.Test3();
lib.vars.Test4 = new lib.Test4();
lib.vars.Test5 = new lib.Test5();
lib.vars.Test6 = new lib.Test6();
lib.vars.Test7 = new lib.Test7();
lib.vars.Test8 = new lib.Test8();
Ready to run.
Test | Ops/sec | |
---|---|---|
Base |
| ready |
1 Chain |
| ready |
2 Chains |
| ready |
3 Chains |
| ready |
4 Chains |
| ready |
5 Chains |
| ready |
6 Chains |
| ready |
7 Chains |
| ready |
8 Chains |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.