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 current(separator, list) {
var out = [];
var idx = 0;
var length = list.length;
while (idx < length) {
if (idx === length - 1) {
out.push(list[idx]);
} else {
out.push(list[idx], separator);
}
idx += 1;
}
return out;
}
function next(separator, list) {
var length = list.length;
var out = Array(length * 2 - 1);
var idx = 0;
while (idx < length) {
var i = idx * 2;
if (idx === length - 1) {
out[i] = list[idx];
} else {
out[i] = list[idx];
out[i + 1] = separator;
}
idx += 1;
}
return out;
}
const arr = Array(1000).fill('a');
Ready to run.
Test | Ops/sec | |
---|---|---|
Current |
| ready |
Next |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.