Please enable JavaScript.
Coggle requires JavaScript to display documents.
2.1.2 Thinking Ahead - Coggle Diagram
2.1.2 Thinking Ahead
Algorithm
Least recently used - Is greedy algorithm where page replaced is least recently used. Idea is based on locality of reference, the least recently used page is not likely
Clairvoyant - 'Looks into future' (statistical data) to predict/shift things to optimise cache - optimal solution - swap out entries that wont be used for longest time - needs info about future cache use - not realistically used in general purpose systems
Any point in time will always make right choice for swap so hit rate is high as possible - statistical analysis used of past use of cache - never perfectly implemented
Counter - where for every access to cache it assigns the value of counter to the entry and then increments it by 1 - the entry with lowest counter removed.
-
Thinking Ahead
Thinking ahead means to step back + consider what solution might look like, what it'll entail, conditions it will work under + how it'll fit in w/ any wider systems or processes
Enables us to consider how solution might be built + start to make some implementation decisions, like how project will be broken down into individual components + what performance enhancements can be utilised
Some computational problems can be complex + will require a team of developers to build final solution. If every developer was asked to build system in own way, it would be chaos unless a systematic approach was followed
-
nature, benefits/drawbacks of caching
Using cache - when requesting data it will go via cache - smallest but faster than og. data source + hold subset of og. data
If requested data is in the cache then the copy in cache is returned = Cache hit - If data isn't in cache it must be copied from og. data source into cache + returned to requester = cache miss - is slower than going directly to data source
Num. of times a cache is hit/missed will determine its overall perf. - measured by comparing num. of hits vs misses - hit rate or hit ratio - percentage
Cache Management - diff. algorithms used to max. cache hits - when cache miss occurs - algorithm used to decide what to remove from cache to make space for data - algorithm choice impacts efficiency of cache
-