Caches and Caching Flashcards
What are the two concepts associated with caching?
Caching and Memory Cache
What is caching?
It is an optimization technique
that speeds up access to slow storage by
storing frequently accessed items in fast
storage.
What is memory cache?
It is a type of fast memory
storage between the CPU and RAM that
stores frequently accessed memory items and speeds up memory access.
What are some instances where caching is used as an optimization technique?
Physical memory cache, Web cache. Disk buffers, VM, TLB
Explain web cache
Speeds up access to web pages by
storing a copy of the frequently accessed pages locally in the computer.
Explain disk buffers in the context of cache.
Store in RAM the disk blocks that are
frequently accessed in the computer.
Explain Virtual Memory in the context of cache
Store in RAM the disk blocks that are
frequently accessed in the computer.
Explain Translation Lookaside Buffer in the context of caching.
Store in RAM the disk blocks that are
frequently accessed in the computer.
What is a Cache Hit?
● When a request is satisfied from cache,
● No need to access Large Data Storage
What is a Cache miss?
● Request cannot be satisfied from cache,
● Item is retrieved from Large Data Storage,
● A copy is placed in cache.
● If cache is full, an item not used recently in the cacheis removed to make room for the new item (LRU-Least Recently Used).
What happens when the cache is full?
an item not used recently in the cacheis removed to make room for the new item (LRU-Least Recently Used).
What is the hit ratio in context of cache?
● Percentage of requests satisfied from cache between 0 and 1.
What is the miss ratio in the context of cache?
● Percentage of requests not satisfied from cache.
● Time = r * Thit + (1-r)*Tmiss Thit < Tmiss
What are the worse and best cases of cache in terms of hit ratio?
● In the worst case (r=0) the cost will be the same as not having cache at all.
● In the best case (r=1), all accesses will be in the cache.
What is Locality of Reference?
refers to repetitions of the same request.