Test name | Executions per second |
---|---|
f32 iterate | 618.9 Ops/sec |
f32 set | 4699.0 Ops/sec |
f64 iterate | 667.2 Ops/sec |
f64 set | 1679.6 Ops/sec |
arr iterate | 308.7 Ops/sec |
var length = 1e6;
var f32_a = Float32Array.from({length}, Math.random);
var f32_b = Float32Array.from({length}, Math.random);
var f64_a = Float64Array.from({length}, Math.random);
var f64_b = Float64Array.from({length}, Math.random);
var arr_a = Array.from({length}, Math.random);
var arr_b = Array.from({length}, Math.random);
for (var i = 0; i < length; i++) {
f32_b[i] = f32_a[i];
}
f32_b.set(f32_a);
for (var i = 0; i < length; i++) {
f64_b[i] = f64_a[i];
}
f64_b.set(f64_a);
for (var i = 0; i < length; i++) {
arr_b[i] = arr_a[i];
}