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 nums = [34,513,513434, 13453145, 134555, 133, 44113, 5, 1,34,23,54326,462,436452,64526,2456,2456,2456,2465,2456,3425,234,2341,324,534,5435,234,34324,123213,123,123,123,4324,234,234,234];
const bits = 30;
const bitsLessThan32 = 32 - bits;
const mask = 0xFF_FF_FF_FF >>> bitsLessThan32;
const maskn = 0xFF_FF_FF_FFn >> BigInt(bitsLessThan32);
const a = integer => Math.clz32(
typeof integer === "number" ? (integer & mask) :
Number(BigInt.asUintN(bits, integer))
) - bitsLessThan32;
const b = integer => Math.clz32(
typeof integer === "number" ? (integer & mask) :
Number(integer & maskn)
) - bitsLessThan32;
Ready to run.
Test | Ops/sec | |
---|---|---|
a |
| ready |
b |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.