Thursday, July 12, 2018

c++ - How does cache associativity affect coding performance?

I understand how temporal/spatial locality affect design decisions when coding and I also understand when alignment affects cache performance. However, could somebody please demonstrate an example of some C++ where the cache associativity is taken into account to make a piece of code faster?




Lets say x86, Intel CPU where the L1 cache is 8-way set associative, the L2 is 8-way set associative and the L3 is 16-way set associative.



(My overall aim of this question is to understand how set associativity affects performance when writing code and "programming to the hardware" to gain performance when you know your target architecture)

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...