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
var results_short = [
'NORTH',
'NORTHEAST', 'NORTHEAST',
'EAST', 'EAST',
'SOUTHEAST', 'SOUTHEAST',
'SOUTH', 'SOUTH',
'SOUTHWEST', 'SOUTHWEST',
'WEST', 'WEST',
'NORTHWEST', 'NORTHWEST',
'NORTH', 'NORTH'];
function test_short(angle) {
return results_short[Math.floor(angle/22.5)];
}
var results_long = [];
for (var i = 0; i < 360; i++) {
results_long[i] = results_short[Math.floor(i/22.5)];
}
function test_long(angle) {
return results_long[angle];
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Short |
| ready |
Long |
| ready |
Short (no function call) |
| ready |
Long (no function call) |
| ready |
Long (no function call) with floor |
| ready |
experimental |
| ready |
experimental - end of array |
| ready |
experimental - beginning of array |
| ready |
experimental - every second element |
| ready |
experimental - random element |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.