What does it mean by cold cache and warm cache concept?

前端 未结 5 945
广开言路
广开言路 2020-12-04 17:33

I read a paper and it used terms cold cache and warm cache. I googled about this terms but I didn\'t find something useful (only a thread h

5条回答
  •  清歌不尽
    2020-12-04 18:12

    enter image description here

    Background:

    Cache is a small and faster memory, that helps avoid CPU to access main memory (bigger and slower) to save time (cache reads are ~100 x faster than reads from main memory). But this only helps if the data that your program needs has been cached (read from main memory into cache) and is valid. Also, cache gets populated with data over time. So, cache can be:
    1. Empty, or
    2. can contain irrelevant data, or
    3. can contain relevant data.


    Now, to your question:

    Cold cache: When the cache is empty or has irrelevant data, so that CPU needs to do a slower read from main memory for your program data requirement.

    Hot cache: When the cache contains relevant data, and all the reads for your program are satisfied from the cache itself.

    So, hot caches are desirable, cold caches are not.

提交回复
热议问题