Cache 22! – Part 1

Standard

Here is the Part 1 of Cache concepts. Hope it steps up to the Cache Optimization post.

What is a Cache?

Cache is the name given to the highest or first level of memory hierarchy encountered once the address leaves the processor.

Memory Hierarchy

Why use a Cache?

In Computer Architecture, Principle of locality is the phenomenon where the same value or related storage locations are frequently accessed by the processor. Hence to improve performance, those frequently accessed information are stored in a fast piece of memory closest to the CPU, called the “Cache”. Depending on its closeness, there are L1, L2 and L3 caches. Higher the level, slower the cache. Higher the level, bigger the cache.

What is Cache Hit and Cache Miss?

When the processor finds the required data item in the cache, it is called a Cache Hit. When the processor does not find the data it requires in the cache, a Cache Miss is said to have occurred.

What is Miss Penalty?

When there is a Cache Miss, the system needs to fetch the data required by the processor from a higher level of cache (or from the main memory or the hard disk), which takes time. The cost/miss is called Miss Penalty.

PS: More on Cache Memory coming up later!

Leave a comment