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
Added testing of accessing long/short function names.
function TraditionalPrototypeClass() {
}
TraditionalPrototypeClass.prototype.foo = function() {
var i = 1;
i++;
};
TraditionalPrototypeClass.prototype.bar = function() {
var i = 1;
i++;
};
TraditionalPrototypeClass.prototype.barlonglongGreatFunctionNameToBeClear = function() {
var i = 1;
i++;
};
function ModulePatternClass() {
this.foo = function() {
var i = 1;
i++;
};
this.bar = function() {
var i = 1;
i++;
};
this.barlonglongGreatFunctionNameToBeClear = function() {
var i = 1;
i++;
};
}
var ModuleCachePatternClass = (function () {
function foo() {
var i = 1;
i++;
}
function barlonglongGreatFunctionNameToBeClear() {
var i = 1;
i++;
}
function bar() {
var i = 1;
i++;
}
return function () {
this.foo = foo;
this.bar = bar;
this.bar2 = barlonglongGreatFunctionNameToBeClear;
this.barlonglongGreatFunctionNameToBeClear = bar;
this.barlonglongGreatFunctionNameToBeClear2 = barlonglongGreatFunctionNameToBeClear;
};
}());
var standardObject = {
foo: function(){
var i = 1;
i++;
},
barlonglongGreatFunctionNameToBeClear: function(){
var i = 1;
i++;
},
bar: function(){
var i = 1;
i++;
}
};
Ready to run.
Test | Ops/sec | |
---|---|---|
Prototype short |
| ready |
Prototype long |
| ready |
object |
| ready |
object long |
| ready |
short to long |
| ready |
long to short |
| ready |
long |
| ready |
short |
| ready |
Module long |
| ready |
Module short |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.