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 build1(c, n) {
var r = '';
for (var i = 0; i < n; i++) {
r = r + c;
}
return r;
}
function build2(c, n) {
var r = [];
for (var i = 0; i < n; i++) {
r.push(c);
}
return r.join('');
}
function build3(c, n) {
var r = c;
while (r.length < n) {
r = r + r;
}
return r.substr(0, n)
}
function build4(c, l) {
var a = Array(l);
while (l--) {
a[l] = c;
}
return a.join('');
}
Ready to run.
Test | Ops/sec | |
---|---|---|
For |
| ready |
Array Join |
| ready |
Binary |
| ready |
Zetlen |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.