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
Number.prototype.plus = function plus(b) { return this + b; }
function plus(a, b) { return a + b; }
function genericPlus(a, b) {
return typeof a === 'string' ? 'not supported' :
typeof a === 'number' ? a + b : 'not supported';
}
var pluses = {
number: function(a, b) { return a + b; },
string: function(a, b) { return 'not supported' }
};
function genericPlus2(a, b) {
return pluses[typeof a](a, b);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
As Method |
| ready |
As Function |
| ready |
Apply Method |
| ready |
Typeof |
| ready |
Typeof Map |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.