Published by Patrick Mutisya · 14 days ago
Show understanding of how various factors contribute to the overall performance of a computer system.
The fundamental performance equation is:
\$\text{CPU Time} = \frac{\text{Instruction Count} \times \text{CPI}}{\text{Clock Rate}}\$
where:
| Factor | Effect on Performance | Typical Mitigation Techniques |
|---|---|---|
| Clock Speed | Higher frequency reduces the denominator of the performance equation, decreasing CPU time. | Advanced semiconductor processes, dynamic frequency scaling. |
| CPI (Cycles per Instruction) | Lower CPI reduces the numerator, speeding up execution. | Pipelining, superscalar execution, micro‑op fusion. |
| Instruction Count | Fewer instructions mean less work to be performed. | Optimised compilers, use of complex instruction set (CISC) vs. reduced instruction set (RISC). |
| Cache Hierarchy | Effective caching reduces memory access latency, lowering CPI for memory‑bound instructions. | Multi‑level caches, larger cache lines, write‑back policies. |
| Pipelining | Allows overlapping of instruction stages, effectively decreasing CPI. | Deep pipelines, hazard detection and forwarding. |
| Parallelism (Multiple Cores / SIMD) | Enables simultaneous execution of independent instructions, reducing overall program time. | Multi‑core designs, vector units, thread-level parallelism. |
| Branch Prediction | Accurate prediction prevents pipeline stalls caused by control hazards. | Dynamic predictors, hybrid schemes. |
Consider a program that executes 1.2 × 10⁹ instructions on a processor with a 2.5 GHz clock and an average CPI of 1.8.
\$\text{CPU Time} = \frac{1.2 \times 10^{9} \times 1.8}{2.5 \times 10^{9}} = \frac{2.16 \times 10^{9}}{2.5 \times 10^{9}} = 0.864\ \text{s}\$
If a cache optimisation reduces the average CPI to 1.4, the new execution time becomes:
\$\text{CPU Time}_{\text{new}} = \frac{1.2 \times 10^{9} \times 1.4}{2.5 \times 10^{9}} = 0.672\ \text{s}\$
This illustrates how a modest reduction in CPI can produce a noticeable performance gain.