Processor cache and its importance

In computer science, there are three types of memory:

  1. Cache memory

  2. Primary memory [main memory]

  3. Secondary memory

To increase performance, the execution speed of data transfers to the processor must be increased, but reducing the amount of storage must be done as a trade-off.

In general, caches have the least amount of storage, followed by RAM [main memory], then secondary memory.

In what ways does the cache contribute?

Whenever we write programs, we write code with a set of instructions that the CPU (processor) will run. During execution, the following transfers will take place:

  1. From secondary memory to main memory

  2. From main memory to cache (this memory will reside closer to the CPU)

As a starting point, there was a transfer of data from secondary memory to main memory. We must design a faster instruction transfer rate to CPU to take full advantage of processor capabilities in terms of code execution. Though RAM is fast, it won't be able to provide instructions at the speed that today's high speed processors require. Hence, cache memory can play a role here.

Additionally, the memory controller transfers instructions from RAM [main memory] to the cache. The cache executes code within the CPU quickly and delivers instructions sequentially to the processor faster.