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 x = new Uint8Array(4)
const storeUint8 = (
buff,
n,
start,
len,
) => {
// can be so much faster...
// just specific
for (let index = start; index < start + len; index++) {
const byte = n & 0xff
buff[index] = byte
n = (n - byte) / 256
}
}
const wrtiteUint32 = (dest, val, offset) => {
dest[offset + 0] = val
dest[offset + 1] = val >>>= 8
dest[offset + 2] = val >>>= 8
}
const wrtiteUint32NoAs = (dest, val, offset) => {
dest[offset + 0] = val
dest[offset + 1] = val >>> 8
dest[offset + 2] = val >>> 16
}
Ready to run.
Test | Ops/sec | |
---|---|---|
store using fn |
| ready |
store using bytes |
| ready |
store using bytes + change in place |
| ready |
store using bytes from fn |
| ready |
fn no a |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.