COD Ch. 2 The Role of Performance
COD Ch. 2 The Role of Performance
COD Ch. 2 The Role of Performance
2
The Role of Performance
Performance
Performance is the key to understanding underlying motivation
for the hardware and its organization
Measure, report, and summarize performance to enable users to
make intelligent choices
see through the marketing hype!
CPU time
doesn't count waiting for I/O or time spent running other programs
can be divided into user CPU time and system CPU time (OS calls)
CPU time = user CPU time + system CPU time
elapsed time = user CPU time + system CPU time + wait time
Our focus: user CPU time (CPU execution time or, simply,
execution time)
time spent executing the lines of code that are in our program
Definition of Performance
For some program running on machine X:
PerformanceX / PerformanceY = n
Clock Cycles
Instead of reporting execution time in seconds, we often use
cycles. In modern computers hardware events progress cycle by
cycle: in other words, each event, e.g., multiplication, addition,
etc., is a sequence of cycles
seconds cycles seconds
program program cycle
Clock ticks indicate start and end of cycles:
cycle time
tick
tick
equivalently
4th
5th
6th
...
time