Coa Unit 1 Problems
Coa Unit 1 Problems
Coa Unit 1 Problems
3. PERFORMANCE OF A COMPUTER
Determining the performance of computers
Performance of A Computer
can be tough. Main reasons for this
Size and Complexity
difficulty are,
performance improvement techniques
Size and Complexity of 1. Defining Performance
Response time
modern software systems,
Throughput
Wide range of performance
1
improvement tech niques 𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒𝑥 =
𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝑥
used by hardware designers.
2. Relative Performance
𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒𝐴 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐵
3.1. DEFINING PERFORMANCE =
𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒𝐵 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒𝐴
If a program is run on two different desktop 3. Measuring Performance
computers, in general the faster one is the clock time
desktop computer that finishes the job done 4. CPU Execution Time
first. 4.1. Types of CPU time
User CPU time
Consider a datacenter that had several System CPU time
servers running jobs submitted by many System clock
users, in general the faster computer is the Clock cycles
one that completed the most jobs during a
day.
Consider two computers X and Y, if the performance of X is greater than the performance of Y, then
𝟏 𝟏
>
𝑬𝒙𝒆𝒄𝒖𝒕𝒊𝒐𝒏 𝑻𝒊𝒎𝒆𝒙 𝑬𝒙𝒆𝒄𝒖𝒕𝒊𝒐𝒏 𝑻𝒊𝒎𝒆𝒚
If computer A runs a program in 10 seconds and computer B runs the same program in 15 seconds,
how much faster is A than B.
𝟏𝟓/𝟏𝟎 = 𝟏. 𝟓
𝑷𝒆𝒓𝒇𝒐𝒓𝒎𝒂𝒏𝒄𝒆𝑨
= 𝟏. 𝟓
𝑷𝒆𝒓𝒇𝒐𝒓𝒎𝒂𝒏𝒄𝒆𝑩
P ERFORMANCE AND EXECU T I ON TIME ARE RECIPR O CALS , increasing performance decreases execution
time.
The most common definition of time is wall clock time, response ti me or elapsed
time.
Processor may work on several programs simultaneously in order to optimize throughput instead of
minimizing the elapsed time for one program.
We need to differentiate the elapsed time and amount of time which the processor is working on the
program. CPU execution time is used to differentiate this.
Differentiating between system and user CPU time is difficult to do accurately, to increase the system
performance the computer designers must know how fast th e hardware can perform
basic functions .
In general CPU performance is a one of metrics for measuring the performance. To know the CPU
performance we must find the CPU execution time.
𝟏
𝑪𝒍𝒐𝒄𝒌 𝑪𝒚𝒄𝒍𝒆 𝑻𝒊𝒎𝒆 =
𝑪𝒍𝒐𝒄𝒌 𝑹𝒂𝒕𝒆
It is clear that the hardware designer can IMPROVE PERFORMANCE by reducing the number of
clock cycles required for a program or the length of th e clock cycle .
These formulas are used to compare two different implementati ons or to evaluate a
design alternative.
Consider the computer with three instruction classes and CPI measurement as given below and
instruction count for each instruction class for the same program from two different compilers
are given. Assume that the computer`s clock rate is 4GHz. Which code sequence will execute
faster according to execution time
COMPILER 1:
Total CPU time of Compiler 1 is the sum of CPU time of all Instruction Classes
2×1 1
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶1𝐴 = =
4 2
1×2 1
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶1𝐵 = =
4 2
2×3 3
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶1𝐶 = =
4 2
1 1 3 5
𝑇𝑜𝑡𝑎𝑙 𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶1 = + + = = 2.5
2 2 2 2
COMPILER 2:
Total CPU time of Compiler 2 is the sum of CPU time of all Instruction Classes
4×1
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶2𝐴 = = 1
4
1×2 1
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶2𝐵 = = =0.5
4 2
2×1 1
𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶2𝐶 = 1 x 3 =
= 0.75
44 2
1 1
𝑇𝑜𝑡𝑎𝑙 𝐶𝑃𝑈 𝑇𝑖𝑚𝑒𝐶2 = 11+
+ 0.5++ 0.75
= 2= 2.25
2 2
The CPU time required for the execution various class of instruction by compiler 2 is less than that of
compiler 1, therefore compiler 2 is faster than compiler 1
add a, b, c
It instructs a computer to add the two variables b and c and to put their sum in a.
For example, If we want to calculate the sum of four variables b, c, d, e and to place the result in the
variable a.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: