typedarray-vs-ordinary-array

Benchmark created on


Setup

const SIZE = 1_000;

Test runner

Ready to run.

Testing in
TestOps/sec
Typed array array
const floatArray = new Float32Array(SIZE);
for (let i = 0; i < SIZE; i++) {
  floatArray[i] = i;
}

for (let i = 0; i < SIZE; i++) {
  floatArray[i] *= 2;
}
ready
Normal array
const normalArray = new Array(SIZE);
for (let i = 0; i < SIZE; i++) {
  normalArray[i] = i;
}

for (let i = 0; i < SIZE; i++) {
  normalArray[i] *= 2;
}
ready

Revisions

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