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 to generate a random date string
function randomDate() {
const year = Math.floor(Math.random() * (2023 - 1970 + 1)) + 1970;
const month = String(Math.floor(Math.random() * 12) + 1).padStart(2, "0");
const day = String(Math.floor(Math.random() * 31) + 1).padStart(2, "0");
return `${year}-${month}-${day}`;
}
// Function to generate a random floating-point number as a string
function randomFloatAsString() {
const randomFloat = (Math.random() * (1000 - 0) + 0).toFixed(2);
return randomFloat;
}
// Generate 4100 random values
const randomValues = Array.from({ length: 4100 }, () => ({
date: randomDate(),
value: randomFloatAsString(),
}));
const L1 = L2 = L3 = U1 = U2 = U3 = randomValues;
function testpower(a, b) {
const outputPower = [];
if (a.length === b.length) {
for (let x = 0; x < a.length; x++) {
outputPower.push({
x: new Date(a[x].date).getTime(),
y: parseFloat(a[x].value) * parseFloat(b[x].value),
});
}
}
return outputPower;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
test 1 |
| ready |
test 2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.