Why does updating a struct array sequentially become 4x slower when threads write to adjacent indices? (stackoverflow.com)stack
17 points by skatd in stackoverflow.com · 23d ago · stack comments
I am benchmarking a parallelized array processing function in C++20. I noticed a weird performance degradation that defies standard algorithmic logic. I have an array of simple tracking counters. When a single thread loops through and updates the elements sequentially, it finish…