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 n, N, i, I, sparse = [],
full = [],
full2 = [];
N = 16384;
I = 8;
for (i = 0; i < I; i++) {
do {
n = (N * Math.random()) | 0;
if (n > (N - 1)) {
n = N - 1;
}
} while (sparse[n]);
sparse[n] = -100 + 200 * Math.random();
}
full.length = N;
full2.length = N;
for (i = 0; i < N; i++) {
if (typeof sparse[i] === "number") {
full[i] = sparse[i];
full2[i] = sparse[i];
} else {
full[i] = 0;
full2[i] = -100 + 200 * Math.random();
}
}
```

Ready to run.

Test | Ops/sec | |
---|---|---|

Sparse array sum |
| ready |

Full array sum |
| ready |

Running sparse on full array |
| ready |

Sum all elements on a full array without zeros |
| ready |

You can edit these tests or add more tests to this page by appending /edit to the URL.

- Revision 1: published by Mattias Ernelli on
- Revision 3: published on
- Revision 6: published by Jasmine on
- Revision 7: published on
- Revision 8: published by Andreas Öman on
- Revision 9: published on
- Revision 10: published on
- Revision 11: published on
- Revision 12: published on
- Revision 16: published by Lee Byron on
- Revision 19: published on
- Revision 21: published on
- Revision 22: published on
- Revision 23: published on
- Revision 24: published on
- Revision 25: published by Tom on
- Revision 26: published by Volodymyr Vadyak on
- Revision 27: published by Volodymyr Vadyak on
- Revision 28: published on
- Revision 29: published on