Array vs Float32Array (v2)

Revision 2 of this benchmark created on


Description

Compare Array vs Float32Array creation

Setup

for (let i = 0; i < 1_000_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 < 1_000_000; i++) {
	const _b = [0,0];
}
ready
Float32Array
for (let i = 0; i < 1_000_000; i++) {
	const _a = new Float32Array(2);
}
ready
Object
for (let i = 0; i < 1_000_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.