Sei sulla pagina 1di 22

EEE429

TEST 1

TOPICS: ALL topics


DATE: 3 Nov 2011
TIME: 9am – 10:30pm
VENUE: Dewan Peperiksaan
Why computer performance important?
• To understand computer organization Vs architecture
– What is the real problem, i.e. software or hardware related?
– Why are some applications better than others for different hardware?
– Why is some hardware better than others for different applications?
– How does the machine’s instruction set affect system performance?
– What factors of computer performance are hardware related?

• Decision making
– Which computer system has a better performance?
– Should a company improve its computing facilities?
– Should a company opt for new computer systems or upgrade existing
ones?
– Do we need a new machine, newer application version or new
operating system?
What is computer performance?
• Performance is usually a measure of how well a computer
performs a task.

• It concerns quantity or quality, or both.

• For example, consider the remark:


“Computer A has a better performance than computer B”
From this remark, few questions can be posed regarding
computer performance:
• Is computer A faster than computer B?
• Does computer A able to complete more jobs than
computer B within a given time?
Terms used to describe
computer performance

• CPU time
– Measures only CPU work involving both user and
system time
– User CPU time, e.g. time spent executing codes in
user’s program.

• Elapse time
– Consider all jobs, including input/output disk and
memory accesses, etc
Metrics of computer performance
• Response time / execution time / latency
– a measure of the time period between the start and completion of
a task. E.g. Type ‘A’ on a computer keyboard. How fast does ‘A’
appear on the computer monitor?
– usually concerns computer user
– reduced response time is desirable
– When dealing with disk assess more appropriate to measure in
terms of average response time of the disk access because

• Throughput / bandwidth
– a measure of total amount of work done in a given time.
– normally used when discussing a computing job.
– usually concerns computer system administrators or managers
– increased throughput is desirable
Throughput Vs Response Time
• Do the following changes to a computer system increase
throughput, decrease response time, or both?

– 1. Replacing the processor in a computer with a faster version.


• ANS: decrease response time

– 2. Adding additional processor to a system that uses multiple


processors for separate tasks.
• ANS: Both

• Conclusion: For most real world computer systems, changing either


execution time or throughput often affects the other.
Basics of computer performance
• Processor circuits are controlled by a timing signal called a clock.

• The clock defines regular time intervals, called clock cycles.

• The time for a complete clock cycle  the length of a clock period.

• Clock period, P of one clock cycle affects the processor performance,


R where
R = 1/P = clock rate
which is a measure of cycles per second or frequency in unit of
Hz.

• Vice versa, P = 1/R


e.g. 500Hz  1/500Hz = 2ns
(cont) Basics of computer performance
• Basic performance equation, execution time,
ExecTime = N*CPI/R
where
N is the no of instructions,
CPI is clock cycles per instruction (i.e. the average no of clock
cycles needed to execute 1 instruction) and
R is cycles per second.

• It is desireable to decrease ExecTime of a computer. Hence, a


computer’s R must be increased, i.e. decrease P.

• Note: Extra care when evaluating computer performance.


– E.g. A processor of 900MHz clock rate is not necessarily better
in performance than a 700MHz processor because they may
have different values of CPI due to different architectural design
or organization.
Measuring Performance
• We know that to increase performance, need to decrease response
time / execution time.

• PerformanceX = 1/ Exec timeX

• For two computers, X and Y,


if the performance of X is greater than the performance of Y,
then

PerformanceX > PerformanceY


1/Exec TimeX > 1/Exec TimeY
Exec TimeY > Exec TimeX

This means, computer Y takes a longer time than computer X to


execute the same program.
Relative Performance  Performance Ratio

• To compare performance of two computers quantitatively,

 1 1 
 − 
Performance ExecTime

 ExecTime ExecTime 
X = Y =n= X Y 100
Performance ExecTime  1 
Y X  ExecTime 
 Y 
 
 

where n is called performance ratio.


Performance Ratio: Example
Computer A takes 10s to execute program SECRET. Computer B takes 15s
to execute the same program.
(a) Which computer has a better performance?
ANS: Computer A

(b)Show calculations to verify (a).


ANS: Perf A / Perf B = ExecTimeB / ExecTimeA = 15s / 10s
Perf ratio A to B = 1.5

(c) What can be deduced from the quantity obtained in (b)?


ANS: “Computer A is 1.5 times faster than computer B”
Speed-up factor: Amdahl’s Law
• Normally calculated for multiple processor system.
• When an enhancement is made to a computer, the
quantity of enhancement can be measured using
the values of fraction enhanced and speed-up
enhanced, to get a speed-up factor.

• Speed-up
1
=
 fraction _ enhanced 
(1 − fraction _ enhanced ) +  
 speedup _ enhanced 
Computer Performance Over Program
Execution

• “How long does it take to execute a program?”

Program Exec Time = seconds / program


Program Exec Time = (instructions / program) * (Clock cycles /
instruction) * (second / clock cycles)

• CPU ExecTime or simply CPU time (for a program)


= CPU clock cycles for a program * clock cycle time
= no instruction * CPI * clock cycle time
n
• CPU clock cycles = ∑ CPI * C
i =1
i i

where
Ci = no of type i instruction,
CPIi = average no of clock cycles for instruction type i
n = total no of instructions
Millions Instructions per Second (MIPS)

• A common measure of performance for a processor

No instructions frequency
MIPS rate = =
ExecTime * 106 CPI *106
Normally the second equation is used because a machine has fixed
clock rate.

Faster machines normally have higher MIPS rating, but this is not
always true as MIPS can sometimes vary inversely to performance.
How? For example, a program involving floating-point instructions
using software routines takes more time to execute than one using
optional hardware due to larger CPI, but has higher MIPS rating due
to simpler software instructions.
Conclusion: Computer Program Performance
• Different application are sensitive to different aspects of computer performance. Also,
applications running on servers depend much on the I/O performance  relies on both
h/w and s/w. This means total elapsed time measurement is of interest.

• Execution time depends on how many instructions there are in a program, how many
clock cycles needed to execute certain instruction, and how clock cycles per second.

• The components of performance are:


1. CPU execution time for a program
2. Instruction count (i.e. no of instructions)
3. Clock cycles per instruction (CPI)
4. Clock cycle time (i.e. clock cycles per second)

• Performance of a computer program depends on:


1. Algorithm – how many instructions in a program?
2. Programming language – machine language or high-level language? E.g. Java
language uses heavy support data abstraction requires lots of indirect calls, thus
more instruction count needed, thus, lower performance.
3. Compiler – how efficient a compiler translate instructions?
4. Instruction set architecture – how many clock cycles per instruction?
Self-test exercise 1:
Computer Performance

Computer C’s performance is 4 times better


than the performance of computer B, which
runs a given application in 28s. How long will
computer C take to run that application?

Ans:
Using performance ratio,
Perf A / Perf B = n
Perf A = 4 * Perf B
i/Exec A = 4 / Exec B
Exec B = 4 * Exec A
Exec A = 28s / 4
Exec A = 7s #
Self-test exercise 2:
Program Execution time
Program Computer A Computer B
1 2s 4s
2 5s 2s

Identify whether each statement is TRUE or FALSE based on the


above-given information.

(a) Computer A is faster then computer B for program 1.


(b) Computer A is faster than computer B for program 2.
(c) Computer A is faster than computer B for a workload with
equal numbers of executions of programs 1 and 2.
(d) Computer A is faster than or equal to computer B for a
workload with twice as many execution of program 1 as of
program 2.
Ans:
a) T
b) F
c) F
d) T
Improving Processor Performance
• 3 approaches to increase processor speed:
– Reducing the size of logic gates on processor chip. So,
more gates can be packed closely together, reducing the
signal propagation time and hence, enhance processor
speed. By doing this, the clock rate must also be increased.

– Increase the size, number and speed of caches.

– Make changes to processor organization and architecture


to increase the effective speed of instruction execution.
This involves employing parallelism methodology.
Obstacles for increased chip performance

• Higher power dissipation due to increased logic density and


clock speed.

• Increased RC delay due to increased resistance (effect from


thinner connection wires from decreased chip size) and
increased capacitance (effect from closer location of wires).

• Memory speed lags processor speed, causing memory


latency. This happens because memory cannot keep up with
processor speed.
Logic and Memory Performance Gap
 the reason why cache memory is required
What have been done to cater for the
obstacles?
• More emphasis on organization & architectural approaches to
improve computer performance.

• Major changes which have been made to increase parallelism


and so, increase the computational efficiency. The approach is
by:
– Placing multiple processors on a chip, with a large shared
cache. This is referred to as multiple cores. It provides
increased performance without increasing the clock rate
and hence, no increased in power dissipation. The
processors are simple and handled by an efficient
software.
Intel Microprocessor Performance

Potrebbero piacerti anche