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
This is a collection of all the possible loop constructs you can think of. I want to have a comprehensive reference to all creative solutions regardless of beautiful code, standards, etc... the goal is to find the holy grail for the fastest loop.
var result = 0,
steps = 100;
function arrayLoop(a)
{
result = result + a;
return result;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
a |
| ready |
b |
| ready |
c |
| ready |
d |
| ready |
e |
| ready |
f |
| ready |
g |
| ready |
h |
| ready |
i |
| ready |
j |
| ready |
k |
| ready |
l |
| ready |
m |
| ready |
n |
| ready |
o |
| ready |
p |
| ready |
q |
| ready |
r |
| ready |
s |
| ready |
t |
| ready |
u |
| ready |
v |
| ready |
w |
| ready |
x |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.