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
var source = new Uint8Array(4);
var uint32 = new Uint32Array(source.buffer);
function readUInt32_1(littleEndian) {
source[0] = 0x32;
source[1] = 0x65;
source[2] = 0x42;
source[3] = 0x56;
return uint32[0];
}
var view = new DataView(source.buffer);
function readUInt32_2(littleEndian) {
return view.getUint32(0, littleEndian);
}
function readUInt32_3(littleEndian) {
var a0 = source[0],
a1 = source[1],
a2 = source[2],
a3 = source[3];
if (littleEndian)
return ((a3 << 24) >>> 0) + (a2 << 16) + (a1 << 8) + (a0);
else
return ((a0 << 24) >>> 0) + (a1 << 16) + (a2 << 8) + (a3);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Typed Arrays |
| ready |
DataView |
| ready |
Bit twiddling |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.