Download Performance Evaluation: Understanding Computer Organization and Assembly Language and more Study notes Computer Science in PDF only on Docsity!
CS/COE0447: Computer Organization
and Assembly Languageand Assembly Language
Chapter 4Chapter 4
Sangyeun ChoSangyeun Cho
Dept. of Computer Science University of Pittsburgh
Performance evaluationPerformance evaluation
It’s an everyday process…
When you buy food
- Same quantity, then you look at costq y, y
- Same cost, then you look at quantity
- (Assuming same quality!)
When you buy a notebooky y
- You give weights to different features LCD size? CPU speed? M iMain memory size? i? Battery life?
- How do you quantify these and come up with a single score that will guide your decision?
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 2
g y
Performance evaluationPerformance evaluation
Often we face an optimization problem…p p
When cost is fixed
- MMaximize performance (and features)! i i f ( d f t )!
When performance target is achieved
Give me the highest performance computer! Don’t careGive me the highest-performance computer! Don t care
about cost…
- Supercomputers are of this class
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
Computer performanceComputer performance
Have you cared about performance seriously when buying a
computer?
- What were the most important factors when you bought a new PC?
Defining computer performance may not be that simple…
- What do you mean when you say a computer has better performance than another?
We need a common metric
- Remember, however, than a single metric will not say everything about a computer
- • We may need multiple metrics!We may need multiple metrics!
Response time vs. throughput
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
Response time vs. throughputResponse time vs. throughput
Plane DC to Paris Top Speed Passengers Throughput(pmph) Boeing 747 6.5 hours 610 mph 470 286, BAD/Sud Concorde 3 hours^ 1350 mph^132 178,
Which has higher performance?
- Time to deliver 1 passenger
- • Time to deliver 400 passengersTime to deliver 400 passengers
Time for 1 job called
- This is called “response time” or “execution time” or “latency”
- • Time/jobTime/job
Jobs per day called
- This is called “throughput” or “bandwidth”
- Jobs/time
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 5
ConventionsConventions
Throughputg p
- E.g., # of transactions processed per second
- Larger is better
If we are primarily concerned with response time,
performance can be defined as 1/T where T is the response
timetime
- Smaller T is better
- That is, larger (1/T) is better
Machine A isMachine A is NN times faster than Btimes faster than B
- N = performance(A) / performance(B) = time(B) / time(A)
- When we present this statement, we want to have N >1 to eliminate confusion
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 6
confusion
Response time vs. throughputResponse time vs. throughput
Time of Concorde vs. Boeing 747
- Concord is faster
- (6.5 hours / 3 hours) or 2.2 times faster
Throughput of Being 747 vs. Concorde
- 286,700 p·mph / 176,200 p·mph
- 1.6 times higher (faster)
“Boeing 747 is 1.6 times (or 60%) faster than Concorde in
terms of throughput”
“Concorde is 2.2 times (or 120%) faster than Boeing 747 in
terms of flying time (response time)”
We will focus primarily on execution time of a single job for
the remaining discussions
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
g
Time in a computerTime in a computer
When you time a program, what do you measure?y p g y
- Total time to complete a task
- CPU time
- Overheads include disk accesses, memory accesses, I/O activities, OS, y , , overheads, overheads from other programs, …
- “Real time,” “response time,” “elapsed time,” …
We are interested in time spent by CPU on your program
only – there are multiple programs running at the same time
- • “CPU execution time” or “CPU time”CPU execution time or CPU time
- Often divided into system CPU time (in OS) and user CPU time (in user program)
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
What impacts time?What impacts time?
Time = IC×CPI×CCT
IC – # of instructions
- Instruction set architecture (ISA)( )
- Compiler used
CPI (average clock per instruction)
- Microarchitecture (e.g., pipelining, cache size, …)( g , p p g, , )
- (Compiler)
- (ISA)
CCT (equivalently clock rate)( q y )
- Technology & circuit optimization
- Microarchitecture, esp. pipelining
- (ISA)
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 13
WorkloadWorkload
A set of programs run on a computer would form ap g p
workload
- Actual collection of applications
- Synthetic programsy p g
- Kernel loops
- …
To compare two computer systems, a user would typically
compare the execution time of the workload on the two
machineshi
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 14
Benchmark suitesBenchmark suites
A benchmark suite is a set of applications relevant for performance
evaluationevaluation
SPEC (standard performance evaluation corporation)
- www.spec.orgwww.spec.org
- CPU benchmarks
- Server benchmarks
- Graphics benchmarks
- • …
EEMBC (embedded microprocessor benchmark consortium)
- Automotive
- Consumer
- Network
- Telecom
- Office
- …
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
Synthetic benchmarksSynthetic benchmarks
A synthesized program intended to mimic real programsy p g p g
• A = B×C+D/E+F;
One may write a synthetic benchmark to exercise a specificOne may write a synthetic benchmark to exercise a specific
sequence of actions
- A program that maximally exercises the multiplication unit in CPU
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
Kernel programs (or loops)Kernel programs (or loops)
An important portion of a real programp p p g
- Quicksort
- Matrix multiplication
Real programs usually consist of many loops and functions
and it may be quite difficult to understand and interpret any
performance evaluation results if we are only given summaryperformance evaluation results if we are only given summary
information
In the case kernel programs, we immediately understand
what’s going on in the programs
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 17
Summarizing performanceSummarizing performance
Computer A Computer B Program 1 (sec) 1 10 Program 2 (sec) 1000 100
Computer A is 10 times faster than B for program 1
Total time (sec) 1001 110
p p g
Computer B is 10 times faster than A for program 2
Although the above statements are correct individually, theyl h h h b i di id ll h
present a confusing picture…
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 18
Arithmetic meanArithmetic mean
Assume that we have N programsp g
Arithmetic mean (AM) = (∑ Time i)/N
Weighted arithmetic mean = ∑ Time i×Wi, ∑ Wi = 1
AM is a special case of weighted AM where W i = 1/N
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
Normalized timeNormalized time
Computer A Computer B Ratio Program 1 1 (0.1) 10 (1) 0. Program 2 1 (10) 0.1 (1) 10
Normalized time maintains the ratio of the original times
Sum 2 (10.1) 10.1 (2)
However, depending on the reference, the result can be
different!
Summing (e.g., arithmetic mean) the normalized times maySumming (e.g., arithmetic mean) the normalized times may
not produce the same comparison result
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
AmdahlAmdahl s law’s law
Time (^) before Time (^) unaffected Time (^) affected
Time (^) after Time (^) unaffected improvement factor
If we extend this basic form, we have
- Timeafter=T 1 /N 1 +T 2 /N 2 +…+TM/N (^) M where Ti is a portion of Time (^) before and Nd N i (^) i is the improvement ratio (or speedup) applied to the program h i i ( d ) li d h execution portion
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 25
Fallacies and pitfallsFallacies and pitfalls
Pitfall 1: Expecting the improvement of one aspect of ap g p p
computer to increase performance by an amount
proportional to the size of the improvement
Pitfall 2: Using a subset of the performance equation as a
performance metric
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 26
SummarySummary
Performance evaluation is an important stage of any designp g y g
and engineering process
We are interested in measuring computer performance
where the goal iswhere the goal is
- Software improvement
- Hardware improvement
- • Or bothOr both
We need relevant metrics and a method to summarize
measurements
Latency vs. throughput
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
SummarySummary
Response time (latency) = time to finish a given jobp y g j
Throughput = # of jobs done in a second
TiTi me = # of clock cycles# f l k l × clock cycle timel k l i
# of clock cycles = # of instructions × CPI
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh
SummarySummary
Workloads used in performance evaluation are typically
drawn from real applications
Synthetic or kernel benchmarks are often useful
A benchmark suite is a set of applications designed to aidpp g
performance evaluation tasks
- Easier experiments, fair comparison, consistent reporting, …
Summarizing results
- Use arithmetic mean (AM) for measured times
- Use geometric mean (GM) for ratiosg ( )
Amdahl’s law
- Dictates the actual performance improvement due to a speedup factor applied to a limited portion of a program
CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh