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 base64ToBytes(base64) {
const binString = atob(base64);
return Uint8Array.from(binString, (m) => m.codePointAt(0));
}
function decode_utf8( s ) {
return decodeURIComponent( escape( atob(s) ) );
}
function decode_utf8_noescape( s ) {
return decodeURIComponent(atob(s) );
}
///////
function bytesToBase64(bytes) {
const binString = Array.from(bytes, (byte) =>
String.fromCodePoint(byte),
).join("");
return btoa(binString);
}
function encode_utf8( s ) {
return btoa(unescape( encodeURIComponent( s ) ));
}
function encode_utf8_nounescape( s ) {
return btoa(encodeURIComponent( s ));
}
///////
let str = 'a Δ π ζ δΈ π¦'
while (str.length < 1_000_000) {
str = str.concat(str);
}
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| Text(En/De)coder | | ready |
| (de/en)codeURIComponent + (un)escape | | ready |
| (de/en)codeURIComponent | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.