Spacial Locality in loops
问题 From what I understand, spacial locality has to do with nearby memory being used in the nearby future. However I was wondering if a loop is executed many times, does this lead to good spacial locality? Thanks in advance, and sorry if I'm hard to understand. 回答1: The number of iterations of a loop doesn't necessarily affect spatial locality. What the loop is doing does. In practice, the key to spatial locality really has to do with cache lines. In simple terms, a program that limits its