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
The fastest syntax in for, forEach, and while.
<script>
var array = [],
sum = 0,
i = 0,
length = 0;
array.length = 10000;
for (i = 0; i < array.length; i = (i + 1) | 0) {
array[i] = i;
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
forEach, += |
| ready |
forEach, sum + v |
| ready |
forEach, recognize integer |
| ready |
for, no cache, increament is behind. |
| ready |
while, no cache, increament is behind. |
| ready |
for, no cache, prelude increament |
| ready |
while, no cache, prelude increament |
| ready |
while, no cache, prelude increament, recognize integer. |
| ready |
while, no cache, prelude increament, recognize integer 2. |
| ready |
while, no cache, prelude increament, recognize integer 3. |
| ready |
for, no cache, recognize integer. |
| ready |
for, decrement is behind. |
| ready |
while, decrement is behind. |
| ready |
for, prelude decrement |
| ready |
while, prelude decrement |
| ready |
for, cache length, increment is behind. |
| ready |
while, cache length, increment is behind. |
| ready |
while, cache length, increment is behind, recognize integer. |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.