1 noInline(Float32Array.prototype.subarray);
2 function createManySubs(howMany, a, b, c, d) {
3 var storage = new Float32Array(howMany * 4);
4 for (var k=0; k < howMany; ++k) {
5 var r = storage.subarray(k * 4, (k + 1) * 4);
6 r[0] = a; r[1] = b; r[2] = c; r[3] = d;
9 r[0] += 2.3; r[1] += 12; r[2] *= 3.14; r[3] -= 999.1;
16 const iterationCount = 25;
17 const arrayCount = 20000;
21 for (var iter=0; iter < iterationCount; ++iter) {
22 a = Math.random() * 10;
23 b = Math.random() * 10;
24 c = Math.random() * 10;
25 d = Math.random() * 10;
26 createManySubs(arrayCount, a, b, c, d);