1. Computer Abstractions and Technology > 1-2. Measuring Performance

Measuring Performance

Updated at 2022.09.12

Measuring CPU performance

  • Clock period: the duration of a clock cycle
    • How long the computer takes to perform a single basic operation
  • Clock rate (frequency): cycles  per  second=1clock  periodcycles\;per\;second = \frac{1}{clock\;period}
    • How many basic operations can be performed in a second
CPU  time=Clock  cycles×Clock  period=Clock  cycles×1Clock  rateCPU\;time = Clock\;cycles \times Clock\;period = Clock\;cycles \times \frac{1}{Clock\;rate}

What is CPI?

Clock Cycles per instruction
: Average number of clock cycles per instruction for a program or program fragment

CPU  time=Clock  cycles×1Clock  rate=Instruction  count×CPI×1Clock  rateCPU\;time = Clock\;cycles \times \frac{1}{Clock\;rate} = Instruction\;count \times CPI \times \frac{1}{Clock\;rate}

CPI can be affected by

  1. Cost for each instruction type: CPIiCPI_i
  2. The frequency of each type of instructions: Fi=Instruction  countiInstruction  countF_i = \frac{Instruction\;count_i}{Instruction\;count}
CPI=i=1nCPIi×Fi\displaystyle CPI = \sum_{i=1}^{n}{CPI_i \times F_i}

More about

Benchmark

: a tool for measuring the performance of computers

  • Metric: Geometric Mean
Performance=1i=1nExecution  time  ratioin=1i=1nExecution  timeX,iExecution  timeREF,in=i=1nExecution  timeREF,iExecution  timeX,inPerformance = \frac{1}{\sqrt[n]{\prod_{i=1}^{n}{Execution\;time\;ratio_i}}} = \frac{1}{\sqrt[n]{\prod_{i=1}^{n}{\frac{Execution\;time_{X,i}}{Execution\;time_{REF,i}}}}} = \sqrt[n]{\textstyle \prod_{i=1}^{n}{\frac{Execution\;time_{REF,i}}{Execution\;time_{X,i}}}}

Amdahl's law

Execution  time  after  improvementExecution\;time\;after\;improvement

=Execution  time  affected  by  improvementAmount  of  improvement+Execution  time  unaffected= \frac{Execution\;time\;affected\;by\;improvement}{Amount\;of\;improvement} + Execution\;time\;unaffected