Array vs Float32Array

Benchmark created on


Description

Compare Array vs Float32Array creation

Setup

for (let i = 0; i < 100_000; i++) {
	const a = new Float32Array(2);
	const b = [0, 0];
	const c = {x: 0, y: 0};
}

Test runner

Ready to run.

Testing in
TestOps/sec
Array
for (let i = 0; i < 100_000; i++) {
	const _b = [0,0];
}
ready
Float32Array
for (let i = 0; i < 100_000; i++) {
	const _a = new Float32Array(2);
}
ready
Object
for (let i = 0; i < 100_000; i++) {
	const _c = {x: 0, y: 0};
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.