News for hackers. Stuff that matters.
Re:Making Python 100x faster with less than 100 lines of Rust by Narishma on Thursday March 30, 2023 @10:44PM (#35381827)
The reason you're not seeing much difference is that your struct is very small, just 16 bytes. In the cases where you're using both x and y in the loop (x1 and x2), you can fit 4 of them in a cache line and you're not wasting space since you need to use both. In the case you're only using one of the values (x3), you're wasting half a cache line and that shows in the benchmark. If you had a bigger struct and/or where you're not using all the members in the calculation, you'd see a much bigger difference in performance between SoA and AoS.

There are no comments on this comment yet.