{"ScriptPreparationCode":null,"TestCases":[{"Name":"DataView (AoS)","Code":"const stride = 10;\r\nconst buffer = new ArrayBuffer(stride * 1000);\r\n\r\n/*\r\n 0 u16 id\r\n 2 f32 x\r\n 6 f32 y\r\n*/\r\n\r\nfor (let i = 0; i \u003C 1000; i\u002B\u002B) {\r\n const struct = new DataView(buffer, i * stride, stride);\r\n struct.setUint16(0, i);\r\n struct.setFloat32(2, i);\r\n struct.setFloat32(6, i * 2);\r\n}\r\n","IsDeferred":false},{"Name":"TypedArray (byte-aligned AoS)","Code":"const stride = 12;\r\nconst buffer = new ArrayBuffer(stride * 1000);\r\n\r\n/*\r\n 0 u16 id\r\n 4 f32 x\r\n 8 f32 y\r\n*/\r\nconst floats = new Float32Array(buffer);\r\nconst u16s = new Uint16Array(buffer);\r\nfor (let i = 0; i \u003C 1000; i\u002B\u002B) {\r\n u16s[i * stride] = i;\r\n floats[i * stride \u002B 4] = i;\r\n floats[i * stride \u002B 8] = i * 2;\r\n}","IsDeferred":false},{"Name":"TypedArray (SoA)","Code":"const buffers = {\r\n id: new Uint16Array(1000),\r\n x: new Float32Array(1000),\r\n y: new Float32Array(1000),\r\n};\r\n\r\nfor (let i = 0; i \u003C 1000; i\u002B\u002B) {\r\n buffers.id[i] = i;\r\n buffers.x[i] = i;\r\n buffers.y[i] = i * 2;\r\n}","IsDeferred":false}]}