Script Preparation code:
x
 
var N = 1000000
var x = new Float32Array(N);
var y = new Float32Array(N);
var z = new Float32Array(N);
var interlaced = new Float32Array(3*N);
var vectors = [];
for (var i = 0, li=x.length; i < li; ++i) {
    x[i] = Math.random();
    y[i] = Math.random();
    z[i] = Math.random();
    vectors.push( {x:Math.random(), y:Math.random(), z:Math.random()} );
}
for (var i = 0, li=interlaced.length; i < li; ++i) {
    interlaced[i] = Math.random();
}
Tests:
  • AoS

     
    var vector;
    for (var i = 0, li=vectors.length; i < li; ++i) {
        vector = vectors[i];
        vector.x = 2 * vector.x;
        vector.y = 2 * vector.y;
        vector.z = 2 * vector.z;
    }
  • SoA

     
    for (var i = 0, li=x.length; i < li; ++i) {
        x[i] = 2 * x[i];
        y[i] = 2 * y[i];
        z[i] = 2 * z[i];
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    AoS
    SoA

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 years ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Chrome 53 on Linux
View result in a separate tab
Test name Executions per second
AoS 13.2 Ops/sec
SoA 2.4 Ops/sec