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
SoA vs AoS
var COUNT = 500;
var objects = [];
var f32Foo = new Float32Array(COUNT);
var f32Bar = new Float32Array(COUNT);
var f32Out = new Float32Array(COUNT);
var arrFoo = [];
var arrBar = [];
var arrOut = [];
var i32Foo = new Int32Array(COUNT);
var i32Bar = new Int32Array(COUNT);
var i32Out = new Int32Array(COUNT);
for (var i = 0; i < COUNT; ++i) {
objects.push({
foo: i,
bar: i + 1,
out: 0
});
f32Foo[i] = i;
f32Bar[i] = i + 1;
f32Out[i] = 0;
i32Foo[i] = i;
i32Bar[i] = i + 1;
i32Out[i] = 0;
arrFoo.push(i);
arrBar.push(i + 1);
arrOut.push(0);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Float32Array |
| ready |
Objects |
| ready |
Int32Array |
| ready |
Array |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.