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
- 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
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]
- 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.