Computer Organisation and Architecture · Pipeline Performance
Speedup for a Given Load and Relation Speedup = M × Efficiency
Overview
Pipeline speedup compares the time to execute a given load without pipelining to the time with pipelining.
When the load is not given, speedup is obtained from the number of stages and the pipeline efficiency through the relation Speedup = M × Efficiency, which also shows that speedup can never exceed the number of stages.
Key concepts
- Speedup (S): time taken to execute the given load without pipelining divided by the time taken to execute the same load with pipelining.
- Efficiency (η): the fraction of time the pipeline stages are usefully busy; its value lies between 0 and 1.
- M: the number of stages (phases) in the pipeline.
- Key relation: Speedup = M × Efficiency.
- Two ways a speedup question can be asked: when the load (number of instructions) is given, and when the load is not given (then the relation with efficiency must be used).
How it works
- When the load is given:
- Compute non-pipelined time = (number of instructions) × (time per instruction without pipeline).
- Compute pipelined time from the pipeline timing diagram.
- Speedup = non-pipelined time ÷ pipelined time.
- Deriving the general relation: from the worked example, speedup = 3 and efficiency = 3/4 with M = 4 stages, giving the general relationship Speedup = M × Efficiency.
- Maximum speedup: since efficiency ≤ 1, the maximum possible speedup = M (number of stages).
If efficiency = 100% (utilization = 1), speedup = M. If efficiency = 75%, speedup = 0.75 × M (M must be known to get a number). - Practical reality: in the timing diagram some slots are wasted (pipeline fill/drain and stalls), so efficiency is never exactly 1 in practice.
Therefore, in practice speedup is always less than M; it can only approach M. In theory, speedup is almost close to M.
Formulas
-
-
= speedup
-
= time to execute the load without pipelining
-
= time to execute the load with pipelining
-
-
= speedup
-
= number of pipeline stages
-
= efficiency ()
-
(when , i.e., 100% utilization)
-
(for a given efficiency; must be known)
Worked examples
Speedup for a load of 9 instructions in a 4-stage pipeline
- Given: load = 9 instructions, pipeline has M = 4 stages, time per stage = 4 time units (so one instruction without pipeline takes 4 × 4 = 16 time units).
- Non-pipelined time = 9 × 4 = 36 time units (each instruction takes 4 units, one per stage, executed serially).
- Pipelined time (from the timing diagram) = 12 time units.
- Speedup .
Check the relation S = M × η
- Efficiency in this example .
- ✔ (relation satisfied).
Question style: efficiency = 100%
- If utilization/efficiency = 100%, speedup = M = number of stages (here 4).
Question style: efficiency = 75%
- Speedup = 0.75 × M; the numerical answer requires knowing the number of stages M.
Revision summary
- Speedup = (time without pipelining) / (time with pipelining).
- Speedup = M × Efficiency — memorise this relation.
- Maximum speedup = M (number of stages), achieved only at 100% efficiency.
- Efficiency lies between 0 and 1.
- In practice, efficiency is never exactly 100% (some slots are wasted), so speedup is always less than M; only in theory does it approach M.
- If a question gives efficiency without the load, you cannot get a numeric speedup unless the number of stages M is known.
Previous-year exam insights
- For a pipeline with M stages, n tasks and one clock cycle per stage (no stalls), speedup S = n·M / (M + n − 1);
as n → ∞, S → M.
Asked inUGC NET 2020UGC NET 2019 - When stage delays are unequal, the clock cycle equals the maximum stage delay (plus register/latch overhead if given), so speedup = (sum of stage delays × n) / (max stage delay × (M + n − 1));
replacing a stage changes both M and the maximum delay.
Asked inGATE 2016 - Speedup must account for clock rate changes: S = ( × ,nonpipe) / ( × ,pipe), i.e., compare time per instruction, not just stage count.
Asked inGATE 2015ISRO 2016 - Stall cycles reduce speedup: effective pipelined time per instruction = 1 + (stall probability × stall cycles), so S = M / (1 + average stall cycles per instruction) for large n.
Asked inGATE 2014 - From S = M × η, the number of stages is M = S / η (equivalently M = S / efficiency);
efficiency is the ratio of useful stage-time to total pipeline time.
Asked inISRO 2013 - Time per instruction = CPI / clock frequency;
when comparing two processors, T = I × CPI / f, so a change in CPI and time determines the required frequency ratio.
Asked inGATE 2014