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 rndchar() {
var charset = "abcdefghijklmnopqrstuvwxyz";
return charset[Math.floor(Math.random() * charset.length)];
}
function rndstr(n) {
var re = "";
for (var i = 0; i < n; ++i) re += rndchar();
return re;
}
var mylongstr = rndstr(10000),
longfind = rndstr(5),
longfindreg = new RegExp(longfind, 'g'),
longrep = rndstr(5),
single = rndchar(),
singlereg = new RegExp(single, 'g');
Ready to run.
Test | Ops/sec | |
---|---|---|
split(single).join(''); |
| ready |
replace(singlereg, ''); |
| ready |
split(longfind).join(''); |
| ready |
replace(longfindreg, ''); |
| ready |
split(longfind).join(longrep); |
| ready |
replace(longfindreg, longrep); |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.