SoA Benchmarks
- We have added a few things in our benchmarks repository: https://github.com/cern-nextgen/wp1.7-soa-benchmark
- Truly contiguous SoA data layouts
- Automatic plots comparing different SoA implementations
- Discussions about summer student Milla working on this.
- Our library now has the same performance than hardcoded SoA in the tested examples only with clang, not with gcc.
- In small examples, such as the one below, I cannot reproduce the issue (both gcc and clang are optimizing away the issue).
#include <vector>
struct SoA_Points { std::vector<float> x, y, z; };
struct S_ref { float &x, &y, &z; };
struct wrapper {
SoA_Points soa_points;
S_ref operator[]( int i ) {
return { soa_points.x[i], soa_points.y[i], soa_points.z[i] };
}
};
int main() {
int N = 100;
wrapper w {{ std::vector<float>(N), std::vector<float>(N), std::vector<float>(N) }};
w[42].x = 3; // Accesses all data members of soa_points, although only x is needed
return 0;
}