Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Buffer Filling
(version: 0)
Comparing performance of:
DataView (AoS) vs TypedArray (byte-aligned AoS) vs TypedArray (SoA)
Created:
4 years ago
by:
Guest
Jump to the latest result
Tests:
DataView (AoS)
const stride = 10; const buffer = new ArrayBuffer(stride * 1000); /* 0 u16 id 2 f32 x 6 f32 y */ for (let i = 0; i < 1000; i++) { const struct = new DataView(buffer, i * stride); struct.setUint16(0, i); struct.setFloat32(2, i); struct.setFloat32(6, i * 2); }
TypedArray (byte-aligned AoS)
const stride = 12; const buffer = new ArrayBuffer(stride * 1000); /* 0 u16 id 4 f32 x 8 f32 y */ const floats = new Float32Array(buffer); const u16s = new Uint16Array(buffer); for (let i = 0; i < 1000; i++) { u16s[i * stride] = i; floats[i * stride + 4] = i; floats[i * stride + 8] = i * 2; }
TypedArray (SoA)
const buffers = { id: new Uint16Array(1000), x: new Float32Array(1000), y: new Float32Array(1000), }; for (let i = 0; i < 1000; i++) { buffers.id[i] = i; buffers.x[i] = i; buffers.y[i] = i * 2; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
DataView (AoS)
TypedArray (byte-aligned AoS)
TypedArray (SoA)
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
soa vs aos vs typed soa
Dataview vs Custom - Read uint32
Dataview vs Custom - Read double
Buffer Access
Comments
Confirm delete:
Do you really want to delete benchmark?