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 keyRule = [
46, 47, 18, 2, 53, 8, 23, 32, 15, 50, 10, 31, 58, 3, 45, 35, 27, 43, 5, 49, 33, 9, 42, 19, 29, 28,
14, 39, 12, 38, 41, 13, 37, 48, 7, 16, 24, 55, 40, 61, 26, 17, 0, 1, 60, 51, 30, 4, 22, 25, 54,
21, 56, 59, 6, 63, 57, 62, 11, 36, 20, 34, 44, 52,
].slice(0, 32)
const mixedKeyCache = []
const getMixedKey1 = (originalKey) => {
const cache = mixedKeyCache[originalKey]
if (cache) {
return cache
}
const mixedKey = []
for (let i = keyRule.length - 1; i >= 0; --i) {
mixedKey[i] = originalKey[keyRule[i]]
}
const mixedKeyString = mixedKey.join('')
mixedKeyCache[originalKey] = mixedKeyString
return mixedKeyString
}
const getMixedKey2 = (originalKey) => {
const mixedKey = []
for (let i = keyRule.length - 1; i >= 0; --i) {
mixedKey[i] = originalKey[keyRule[i]]
}
const mixedKeyString = mixedKey.join('')
return mixedKeyString
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Unofficial 1 |
| ready |
Unofficial 2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.