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
Testing if it is faster to conditionally update a map or to always update it without a conditional
// Example for resourceTypes (< 50 typically)
const mapKeys = new Array(50).fill(0).map(() => Math.random().toString());
const mapToTestWith = new Map();
Ready to run.
Test | Ops/sec | |
---|---|---|
Check for value before setting |
| ready |
Blindly set always |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.