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
Regular vs. object switch.
var switchObject = {
'alpha': function() {
i = i + 1;
},
'beta': function() {
i = i + 2;
},
'_default': function() {
i = i + 3;
}
};
var i = 0;
var methods = ['alpha', 'beta', 'non-existing'];
var method = methods[Math.floor(Math.random() * methods.length)];
Ready to run.
Test | Ops/sec | |
---|---|---|
Object Switch |
| ready |
Regular Switch |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.