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
Also be careful when you use pre- and postdecrement with while or do-while, with do-while and while loops, there'll be differences!
If you know how many runs you have, you should always use a for-loop. Not only because of the increase in perfomance, but because it's clearly indicating said case. Plus you don't have any counting variables left which you could reuse by accident with wrong numbers. Also post- or predecrement/-increment doesn't make a difference which could easily yield a off-by-one-bug if you use a while or do-while.
Ready to run.
Test | Ops/sec | |
---|---|---|
While loop |
| ready |
Do-While loop |
| ready |
For loop (decrementing) |
| ready |
For loop (decrementing) |
| ready |
For loop (incrementing) |
| ready |
For loop (incrementing) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.