100%(1)1 out of 1 people found this document helpful
This preview shows page 1 - 7 out of 27 pages.
LECTURE 1 Response Time and Throughput ●Response time: How long it takes to do a task ● Throughput: Total work done per unit time ○e.g. tasks/transactions/… per hour Relative Performance Performance= 1ExecutionTime●Who’s faster? “X is ntimes faster than Y” ○PerformanceXPerformanceY=ExecutionTimeXExecutionTimeYMeasuring Execution Time ●Elapsed time: Total response time, including all aspects ○Determines system performance ●CPU time: Time spent processing a given job ○Discounts I/O time ○ Comprises userCPU time and system CPU time CPU Clocking Operation of a digital hardware governed by a constant-rate clock
●Clock period: Duration of a clock cycle ○e.g., 250ps = 0.25ns = 250 x 10-12s ●Clock frequency (rate): Cycles per second ○e.g., 4.0 GHz = 4000 MHz = 4.0 x 109 Hz ●CPU Time: ○CPU Time = CPU Clock Cycles x Clock Cycle Time = CPU Clock Cycles x 1ClockRate=ClockRateCPUClockCycles●Performance improved by ○Reducing number of clock cycles ○Increasing clock rate ○Hardware designer must often trade off clock-rate against cycle count CPU Time Example ●Computer A: 2 GHz clock ,10s CPU time ●Designing Computer B ○Aim for6s CPU time
○ Causes 1.2 x clock cyclesA●How fast must Computer B clock be? lockrateCB= CPUTimeBCPUclockcyclesB= ( 6 s)(1.2 xCPUclockcycles)AlockcyclesCPUTimexClockrate10) x(2 GHz) CA= AA= (lockrate4 GHzCB=6 s( 1.2 x(10 x2 GHz) )= LECTURE 2 CPU Performance ●CPU Time: Execution time for a program ○CPU Time = CPU Clock Cycle * Clock Cycle Time ●CPU Clock Cycle: Number of cycles/instructions for a program ●CPU Clock Rate: Number of cycles in one second ⇒Clock Cycles / s ○CPU Clock Rate = 1ClockCycleTime●Clock Cycle Time: Time for a single cycle ○Clock Cycle Time = 1CPUClockRateInstruction Count and CPI ● CPI: Average Cycles Per Instruction
○PIC=ClockCycles# ofinstructions○lockCyclesPI(# ofinstructions) C=C*○PUTimePUClockCyclesClockCycleTimeC=C*CPI in More Detail ●If different instruction classes take different numbers of cycles ○lockCycles(CPIInstructionCount)C= ∑ni=1*i●Weighted Average CPI ○PI(CPI)C=ClockCyclesInstructionCount= ∑ni=1*InstructionCountInstructionCountiPerformance Summary ●Performance depends on:
○ Algorithm:affects IC, possibly CPI ○Programming Language: affects IC, CPI ○ Compiler: affects IC, CPI ○Instruction set architecture: affects IC, CPI, Tc ■PUTimeC=ProgramInstructions*InstructionsClockCycles*SecondsClockCyclePitfall: Amdahl’s Law Improving an aspect of a computer and expecting a proportional improvement in overall performance.TTimproved=TaffectedImprovementFactor+ unaffectedLECTURE 3Registers vs Memory
●Registers are faster to access than memory ●Operating on memory data requires loads and stores ○More instructions to be executed ●Compiler must use registers for variables as much as possible Arithmetic Example C codeCompiled MIPS Code f = (g + h) - (i + j) add $t0, $s1, $s2