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
Not matching the exact same thing, only for perf test reasons
// Sample strings of length 50 each
const testSize = 100000;
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-!?#'ï[].";
const multiBy = "👩🏽🤝👨🏼";
const samples = (new Array(testSize)).fill("").map((str, j) => {
for (let i = 0; i < 50; i++) str += charset.charAt(Math.floor(Math.random() * 72));
if (j%10 === 0) str += multiBy;
return str;
});
const te = str => str.length !== (new TextEncoder().encode(str)).length;
const rx = str => !/[^\x00-\x7F]/.test(str);
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| TextEncoder | | ready |
| RegEx | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.