This article presents a practical benchmark of a particle simulation using both the AoS (Array of Structures) and SoA (Structure of Arrays) data layouts. How much performance can we gain by merely switching up the way our data is stored?
AoS vs SoA in practice: particle simulation
by Vittorio Romeo
From the article:
The benchmark simulates a large number of 2D particles that continuously change position, scale, opacity, and rotation. Through an ImGui-based UI1, you can choose the number of particles, toggle multithreading, and switch between AoS and SoA on the fly.
A demo is worth a thousand words, and since my fork of SFML supports Emscripten, you can try the benchmark directly in your browser. Play around with all the options – I’m curious to hear what results you get! [...]
Add a Comment