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 should be a runnable version of https://www.measurethat.net/Benchmarks/Show/27092/1/forked-1-new-object-from-reduce-vs-foreach-vs-reduce-vs
var objects = Array.from(new Array(1000)).map((r, i) => ({
id: `id-${i}`,
val: i
}));
// Output should be
// { "id-0": 0, "id-1": 1, ... }
Ready to run.
Test | Ops/sec | |
---|---|---|
Populate object via ForEach |
| ready |
Populate new object via Reduce |
| ready |
Populate same object via Reduce (don't use ..., that's just silly) |
| ready |
Let's try Object.assign, since we're here anyway |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.