204k views
2 votes
To use cache memory, main memory is divided into cache lines, typically 32 or 64 bytes long. an entire cache line is cached at once. what is the advantage of caching an entire line instead of a single byte or word at a time?

1 Answer

2 votes

The advantage of catching an entire line instead of a word is based on the principle of spatial locality. If one location is read, the probability of accessing nearby locations remains very high. Thus, by caching an entire line, the probability of a cache hitting next increases. In modern hardware, it is faster to do a block transfer of 32 or 64 bytes into a cache line than reading from a single byte or word at a time

User Matt Toigo
by
5.6k points