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
function random(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
const columnCount = 100;
const rowCount = 10000;
const columnNames = new Array(columnCount).fill().map(() => `Column-${random(0, rowCount*rowCount)}`)
const columnTypes = new Array(columnCount).fill(`integer`)
var data = new Array(rowCount);
for (let i = 0; i < rowCount; i++) {
data[i] = new Array(columnCount).fill(random(0, rowCount*rowCount))
}
const res = columnNames.reduce((acc, columnName) => {
acc[columnName] = { maximum: Number.MIN_VALUE, minimum: Number.MAX_VALUE };
return acc;
}, {});
Ready to run.
Test | Ops/sec | |
---|---|---|
Normal for loop over rows and columns |
| ready |
For-of over rows and columns |
| ready |
Foreach |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.