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
<script src="https://unpkg.com/core-js-bundle@3.40.0/minified.js"></script>
let hexString = "a0ad5928297d11874898c3a7df32839fc65b6f5abf8105cc126ccc158ddcba82ec713a93c3de97";
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;
}
let aBuff = hexPairsToAb(hexString);
function abToHex(bytes) {
return Array.from(bytes).map((byte) => byte.toString(16).padStart(2, "0")).join("");
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Array.from map join |
| ready |
.toHex polyfill |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.