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 which is more performant on large objects..
<div id="dataContainer" style="display: none;" />
<script>
const data = Array.from({ length: 50000 }, (v, i) => ({id: i + 1, num: i}));
// Convert data to JSON and store it in the div
document.getElementById('dataContainer').textContent = JSON.stringify(data);
</script>
// Extract the data from the div
const rawData = document.getElementById('dataContainer').textContent;
const data = JSON.parse(rawData);
let total = 0;
const summ = (_) => total += _.num;
total = 0;
Ready to run.
Test | Ops/sec | |
---|---|---|
anon forEach loop |
| ready |
raw for loop |
| ready |
non anon forEach loop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.