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
convert hex pairs into array buffer
let hexString = "a0ad5928297d11874898c3a7df32839fc65b6f5abf8105cc126ccc158ddcba82ec713a93c3de97";
function hexToAb2(hexString) {
return new Uint8Array(hexString.match(/[\da-f]{2}/gi).map((h) => parseInt(h, 16)))
}
function hexPairsToAb(string) {
let arrayBuffer = new Uint8Array(Math.ceil(string.length / 2));
for (let i = 0; i < string.length; i += 2) {
arrayBuffer[i / 2] = parseInt(string.slice(i, i + 2), 16);
}
return arrayBuffer;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
match + map |
| ready |
plain loop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.