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
<span></span>
let span = document.body.querySelector("span");
class Float32ArrayExtended extends Float32Array {
constructor (val) {
super(1);
this[0] = val;
}
get x () { return this[0]; }
set x (v) { this[0] = v; }
}
class Int32ArrayExtended extends Int32Array {
constructor (val) {
super(1);
this[0] = val;
}
get x () { return this[0]; }let
set x (v) { this[0] = v; }
}
const size = 100000;
const array = new Array(16).fill(1);
const arrayEF32 = new Float32ArrayExtended (16);
const arrayF32 = new Float32Array (16);
const arrayEI32 = new Int32ArrayExtended (16);
const arrayI32 = new Int32Array (16);
let x = 1;
const obj = {
get x() {
return array[0];
},
set x(value) {
array[0] = value;
}
};
let sum = 0;
span.innerText = sum;
Ready to run.
Test | Ops/sec | |
---|---|---|
array [ 0] |
| ready |
setter / getter |
| ready |
Float32Array |
| ready |
class extends Float32Array |
| ready |
Int32Array |
| ready |
class extends Int32Array |
| ready |
Primitive |
| ready |
Direct |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.