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
See: http://stackoverflow.com/q/8483357/1011582
Custom Math.round implementation is:
R1(a,b){var c=a%b;return a-c+(c/b+1.5>>1)*b}
function R1(a,b){var c=a%b;return a-c+(c/b+1.5>>1)*b}
R2 = Math.round;
function R3(a){return Math.round(a)}
tally = 0
Ready to run.
Test | Ops/sec | |
---|---|---|
Custom Math.round |
| ready |
Built-in Math.round (direct) |
| ready |
Built-in Math.round (wrapped) |
| ready |
Custom Math.round #OPT |
| ready |
Built-in Math.round (direct) #OPT |
| ready |
Built-in Math.round (wrapped) #OPT |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.