Cache Memory Performance
Cache Memory Performance
Types of Caches :
Cache that is built into the CPU is faster than separate cache.
Separate cache is faster than RAM. Built-in Cache runs as a speed of a
microprocessor.
Disk Cache : It contains most recent read in data from the hard disk
and this cache is much slower than RAM.
Instruction Cache Vs Data Cache : Instruction or I-cache stores
instructions only while Data or D-cache stores only data.
Distinguishing the stored data by this method recognizes the
different access behavior pattern of instructions and data. For
example : The programs need to involve few write accesses, and they
often exhibit more temporal and spatial locality than the data they
process.
Unified Cache Vs Split Cache : A cache that stores both instructions
and data is referred to as a unified cache. A split cache on other hand,
consist of two associated but largely independent units – An I-cache
and D-cache. This type of cache can also be designed to deal with
two independent units differently.
The Hit ratio is nothing but a probability of getting hits out of some
number of memory references made by the CPU. So its range is 0 <= h
<= 1.
Miss Ratio: The miss ratio is the probability of getting miss out of
some number of memory references made by the CPU.
Miss Ratio = Number of misses / Total CPU references to
memory = Number of misses/ (Number of hits + Number of misses)
Miss Ratio = 1 – hit ratio(h)
Average Access Time ( tavg ) :
tavg = h X tc + ( 1- h ) X ( tc + tm ) = tc + ( 1- h ) X tm
Let tc, h and tm denote the cache access time, hit ratio in cache and and
main access time respectively.
Average memory access time = Hit Time + Miss Rate X Miss Penalty
Miss Rate : It can be defined as he fraction of accesses that are not in
the cache (i.e. (1-h)).
CPU Performance :
CPU time divide into clock cycles that spends for executing
packages/programs, and clock cycles that spend for waiting for memory
system. Cache hits are part of regular CPU cycle.
CPU time = ( CPU execution clock cycles + memory stall clock
cycles ) X Clock Cycle time
I infou… Follow 14
Next Article
Factors affecting Cache Memory
Performance
Similar Reads
Locality of Reference and Cache Operation in Cache Memory
This article deals with the concept of locality of reference and cache
operations in cache memory. Locality of reference refers to the process o…
7 min read
Factors affecting Cache Memory Performance
Computers are made of three primary blocs. A CPU, a memory, and an I/O
system. The performance of a computer system is very much dependent…
5 min read
Article Tags :
Company Explore
About Us Job-A-Thon Hiring Challenge
Legal Hack-A-Thon
Careers GfG Weekly Contest
In Media Offline Classes (Delhi/NCR)
Contact Us DSA in JAVA/C++
Advertise with us Master System Design
GFG Corporate Solution Master CP
Placement Training Program GeeksforGeeks Videos
Geeks Community
Languages DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
GoLang DSA Roadmap
SQL DSA Interview Questions
R Language Competitive Programming
Android Tutorial