CPU Performance

  • clock cycle (time) is the time for one clock period (usually of the processor clock, which runs at a constant rate, usually published as part of the documentation for a computer)

    • note: Although clock cycle time has traditionally been fixed, to save energy or temporarily boost performance, today’s processors can vary their clock rates, so we would need to use the average clock rate for a program.
  • clock rate (CR) is the inverse of the clock cycle time (usually measured in or its multiples)

  • response time (or execution time) is the total time required for the computer to complete a task (including disk accesses, memory accesses, I/O activities, operating system overhead, CPU execution time, etc.)

  • performance is the reciprocal of response time

  • CPU (execution) time (of task) is the actual time the CPU spends computing for a specific task (excluding other activities)

  • throughput (or bandwidth) is the number of tasks completed per unit time

Program Performance

In this subsection, we refer to the performance of some program in a the CPU.

  • instruction count (IC) is the number of instructions executed by the program

  • cycles per instruction (CPI) is the average number of clock cycles per instruction for a program or program fragment

  • CPU clock cycles is the total number of clock cycles consumed by the program

  • CPU (execution) time (of program) is

CPU Time

Problem Solving

Instruction Replacement

EXAMPLE

Given

  • Some of the instructions in the program are replaced by instructions, after which, the program gets shorter by
  • Each two instructions are replaced by five instructions.

Question: How many instructions were replaced?

Answer:

  • 2 instructions has
  • 5 instructions has
  • Therefore, by replacing 2 instructions with 5 instructions, we save , thus, by replacing one instruction, we save .
  • The cycles saved =
  • The number of instructions replaced =

  • Every instructions of type replaced by instructions of type
  • is the time saved (in )
  • is the clock rate of the CPU (in )
  • and are the cycles per instruction for and (resp.)
  • is the total number of instructions replaced

Instruction Count

EXAMPLE

Given

  • CPU A with , and
  • CPU B with , and
  • A program with instructions in running time (after assembly for CPU A)

How many instructions (in running time) would CPU B execute to match the running time of CPU A?

  • (ET=Execution Time)

Amdahl’s Law

  • is the number of processors
  • is the fraction of the program that can be parallelized
  • is the fraction of the program that must be executed sequentially
  • is the speedup of the program when executed on processors
  • and are the execution times of the program before and after the improvement (resp.)