caching Flashcards
cold storage
data not accessed frequently
what is an example of something that would be stored on cold storage
backup data
hard disk
rotating and magnetic
usually used for hard storage
solid state drive
flash memory with fast access times
what type of memory are disks
non volatile
network file system
remote server/cloud based storage
what type of memory is ram
volatile
how is ram packaged
as a chip
what are the 2 types of ram
static and dynamic
sram dram
sram
shorter access time
has 6x more transistors to store bits than dram making it more expensive
dram
usually used as memory on personal devices as its cheaper than sram
registers
v small on chip memory
what is the issue with the cpu memory gap
cpu speed gets bottlenecked by memory speed
what is the cpu memory gap
cpu speed is increasing faster than memory access time
cache
a smaller faster storage device that acts as a staging area for a subset of data in a larger slower device
what is the goal of cache
achieve access speeds of the fastest memory whilst paying the cost of the cheapest
locality principle
accessing a small localised subset of memory
temporal locality
recently accessed data likely to be accessed again in the near future
spacial locality
data near recently accessed addresses likely to be accessed
how do we exploit temporal memory
keep the recently accessed data in the cache
how do we exploit spacial memory
prefetch data before its requested
how do we calculate the cache hit rate
number of hits/ number of lookups
row major order
elements in the same row of an array are stored next to eachother in memory
stride k reference pattern
k = the unit of jumps between memory addresses being accessed