Which is the fastest memory in the memory hierarchy?
Correct answer: Registers. Registers sit inside the CPU and hold the data it is using now, so they are fastest.
Background: The hierarchy runs from registers down to cache, RAM and disk, slower and larger each step.
- Cache: It is very fast, but it sits outside the CPU.
- SRAM: It is the memory used to build cache, but registers are faster.
- DRAM: It is the main RAM, much slower than registers.
Did you know? A CPU has only a few dozen registers, each holding one value.
Memory trick: Closer to the processor means faster.