which is optimal a bigger block cache size or a smaller one?

后端 未结 3 1082
滥情空心
滥情空心 2021-01-21 14:15

Given a cache size with constant capacity and associativity, for a given code to determine average of array elements, would a cache with higher block size be preferred?

3条回答
  •  渐次进展
    2021-01-21 14:42

    From your example code we can't say either way as long as the hardware pre-fetcher can keep up a memory stream at maximum memory throughput.

    In a random access scenario a shorter cache-line might be preferable as you then don't need to fill all the line. But the total amount of cached memory would go down as you need more circuits for tags and potentially more time for comparing.

    So a compromise must be made Intel has chosen 64-bytes per line (and fetches 2 lines) others has chosen 32-bytes per line.

提交回复
热议问题