Sunday, March 9, 2008

Computer Architecture: Measuring Computer Performance

Performance can be measured in many different ways depending on what you're looking for. One primary attribute of computer performance is its execution time. Execution time is the total amount of time needed to perform a task. Lower execution time means better performance so performance and execution time are inversely related.

  • Performance = 1/Execution time
When comparing performances between two computers, if A is n times faster than B it means
  • n = Performance(A)/Performance(B) = Execution Time(B)/Execution Time(A)

The execution time takes into account every time factor that a program encounters, like user inputs and outputs. A more focused way to measure performance is CPU time. CPU time is the amount of time the CPU actually works on the task.

  • CPU time = Total instructions * (average clock cycles per instruction) * clock cycle time
Every program generates instructions for the computer to carry out. Each instruction takes a certain amount of time to do. In a computer, time is referred to as clock cycles or period. They are based on the clock of the computer. Clock cycle is inversely related to its clock period. In the above equation, clock cycle time is just the clock period.

Amdahl's Law
When you improve only a part of a computer's performance, you need to use a different equation to calculate the CPU time.
  • CPU time_after = [(CPU time_before)/amount of improvement + Unchanged CPU time]
Another way to put this equation is:
  • 1 / [(1-P) + (P/S)] where P is the proportion that improved(0 < P < 1) and S is the speedup.


The information above is based on the textbook Computer Organization and Design by David A. Patterson and Hennessy.