Search code examples
cpu-registersmicroprocessors

what is the advantage of using a CPU register for temporarydata storage over using a memory location?


what is the advantage of using a CPU register for temporary data storage over using a memory location ?


Solution

    • registers are accessed usually in 1 cpu cycle (.3 nano-seconds).
    • L1 Cache access is .5 nano-seconds
    • L2 cache access is 7 nano-seconds
    • DRAM access is 200 nano-seconds.

    So you are about 600x faster with registers than working with ram.

    Speeds referenced from here.