Sie sind auf Seite 1von 10

COMPUTER ARCHITECTURE Prof.

Basel Mahafzah Lesson 1 - The role of performance - Part 1

Outline

The Role of Performance


Part 1

Performance Computer Performance Execution Time Definition of Performance Clock Cycles

Performance

Why is some hardware better than others for different programs? (example: G4 vs. pent. 4) What factors of system performance are hardware related?

(e.g., Do we need a new machine, or a new operating system?) How does the machines instruction set affect performance?

Example on performance
Airplane Passengers Boeing 737 Boeing 747 Concorde Douglas 101 470 132 146 Range (mi) 630 4150 4000 8720 Speed (mph) 598 610 1350 544

Copyright Universit Telematica Internazionale UNINETTUNO

COMPUTER ARCHITECTURE Prof. Basel Mahafzah Lesson 1 - The role of performance - Part 1

Which of these airplanes has the best performance?

The plane with the highest cruising speed is the Concorde The plane with the longest range is the Douglas

The plane with the largest capacity is the Boeing 747 How much faster is the Concorde compared to the 747? How much bigger is the 747 than the Douglas?

Airplane Passengers Boeing 737 Boeing 747 Concorde Douglas 101 470 132 146

Speed (mph) 598 610 1350 544

Throughput 228,750 286,700 178,200 79,424

If we define performance in terms of speed, this leaves two possible definitions:

1. Define the fastest plane as the one with the highest speed, taking a single passenger from one point to another in the least time

Copyright Universit Telematica Internazionale UNINETTUNO

COMPUTER ARCHITECTURE Prof. Basel Mahafzah Lesson 1 - The role of performance - Part 1

The Concorde would clearly be the fastest

2. Define the fastest plane as the one with the highest speed, taking 450 passengers from one point to another in the least time

Airplane Passengers

The Boeing 747 would clearly be the fastest. Check the following table

Boeing 737 Boeing 747 Concorde Douglas

101 470 132 146

Speed (mph) 598 610 1350 544

Throughput 228,750 286,700 178,200 79,424

Response Time (latency)

Computer Performance: TIME, TIME, TIME

How long does it take for my job to run? How long does it take to execute a job?

Copyright Universit Telematica Internazionale UNINETTUNO

COMPUTER ARCHITECTURE Prof. Basel Mahafzah Lesson 1 - The role of performance - Part 1

How long must I wait for the database query? The time between the start and completion of a job

Throughput How many jobs can the machine run at once? What is the average execution rate?

How much work is getting done? The total amount of work done in a given time

Example

If we upgrade a machine with a new processor what do we increase? If we add a new machine to the lab what do we increase?

Answer: Case 1: Both response time and throughput are improved

Copyright Universit Telematica Internazionale UNINETTUNO

COMPUTER ARCHITECTURE Prof. Basel Mahafzah Lesson 1 - The role of performance - Part 1

Answer: Case 2: No one task gets work done faster, so only throughput increases

Answer: But by increasing the number of processors would reduce the waiting time in the queue, therefore response time could improve

Elapsed Time

Execution Time

counts everything (disk and memory accesses, I/O, etc.) a useful number, but often not good for comparison purposes

CPU time Doesnt count I/O or time spent running other programs Can be broken up into system time, and user time

Our focus: user CPU time time spent executing the lines of code that are in our program

Copyright Universit Telematica Internazionale UNINETTUNO

COMPUTER ARCHITECTURE Prof. Basel Mahafzah Lesson 1 - The role of performance - Part 1

90.7u

12.9s

2:39

65%

Example: Unix time Command

90.7u: User CPU Time (seconds) 12.9s: System CPU Time (seconds) 2:39: Elapsed Time (159 seconds)

65%: Percentage of Elapsed Time that is CPU Time is (90.7 + 12.9) / 159 = 0.65

More than a third of the elapsed time in this example was spent waiting for I/O, running other programs, or both

Definition of Performance

computer X is n times faster than computer Y PerformanceX/PerformanceY=n For some program running on computer X, PerformanceX =1/Execution TimeX

Copyright Universit Telematica Internazionale UNINETTUNO

COMPUTER ARCHITECTURE Prof. Basel Mahafzah Lesson 1 - The role of performance - Part 1

Example: Computer A runs a program in 10 seconds, Computer B runs the same program in 15 seconds, how much faster is A than B? Answer: A is 1.5 times faster than B

Clock Cycles

Instead of reporting execution time in seconds, we often use cycles

A simple formula relates the most basic metrics (clock cycles and clock cycle time) to CPU time: CPU execution time for a program = CPU clock cycles for a program X Clock cycle time

seconds cycles seconds = program program cycle

Or, because clock rate and clock cycle time are inverses: CPU execution time = CPU clock cycles for a program / Clock rate

Clock ticks indicate when to start activities (one abstraction):

time time

Copyright Universit Telematica Internazionale UNINETTUNO

COMPUTER ARCHITECTURE Prof. Basel Mahafzah Lesson 1 - The role of performance - Part 1

cycle time = time between ticks = seconds per cycle clock rate (frequency) = cycles per second (1 Hz.= 1 cycle/sec)

A 200 MHz. clock has a


1 200 106 109 = 5 nsec

Cycle time

How to Improve Performance

seconds cycles seconds = program program cycle


So, hardware designer can improve performance by reducing either the length of the clock cycle or the number of clock cycles required for a program.

Example

Our favorite program runs in 10 seconds on computer A, which has a 400 MHz. clock. We are trying to help a computer designer build a new computer B, that will run this program in 6 seconds

Copyright Universit Telematica Internazionale UNINETTUNO

COMPUTER ARCHITECTURE Prof. Basel Mahafzah Lesson 1 - The role of performance - Part 1

The designer can use new technology to substantially increase the clock rate, but has informed us that this increase will affect the rest of the CPU design,

causing computer B to require 1.2 times as many clock cycles as computer A for the same program. What clock rate should we tell the designer to target?

Answer

First: find the number of clock cycles required for the program on computer A: CPU timeA = (CPU Clock A CyclesA ) / Clock RateA A A

10 seconds = (CPU clock cyclesA) / 400 x 106 cycles/sec CPU clock cyclesA = 10 sec X 400 X 106 cycles/sec = 4000 X 106 cycles

CPU time for computer B can be found using this equation: CPU timeB = (1.2 X CPU clock cyclesA) / Clock rateB

Copyright Universit Telematica Internazionale UNINETTUNO

COMPUTER ARCHITECTURE Prof. Basel Mahafzah Lesson 1 - The role of performance - Part 1

6 seconds = (1.2 X 4000 X 106 cycles) / Clock rateB Clock rateB = (1.2 X 4000 X 106 cycles) / 6 seconds = (800 X 106 cycles) / second = 800 MHz

Copyright Universit Telematica Internazionale UNINETTUNO

10

Das könnte Ihnen auch gefallen