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
const digitLookup = new Uint8Array(128);
for (let i = 0; i < 83; i++) {
digitLookup[
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~'.charCodeAt(
i,
)
] = i;
}
const decode83lookup = (str, start, end) => {
let value = 0;
while (start < end) {
value *= 83;
value += digitLookup[str.charCodeAt(start++)];
}
return value;
};
const digit =
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~';
const decode83 = (str, start, end) => {
let value = 0;
while (start < end) {
value *= 83;
value += digit.indexOf(str[start++]);
}
return value;
};
const characters =
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~';
function randomBlurHash() {
let result = '|EHV6n';
for (var i = 0; i < 160; i++) {
result += characters.charAt(
Math.floor(Math.random() * characters.length),
);
}
return result;
}
let a = 'aa';
Ready to run.
Test | Ops/sec | |
---|---|---|
lookup |
| ready |
indexof |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.