Estimating the Effect of Speeding Up One Part
The total time saved by an optimization depends on how much of the original run belongs to the improved component.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Work a mixed run
If parsing takes 25 milliseconds and everything else 75, making parsing twice as fast gives 87.5 milliseconds total under a simple serial model. The improvement is 12.5 milliseconds. See end-to-end request traces.
Check what else changes
A new parser might also allocate less memory or change downstream work. Verify total behavior under comparable conditions rather than assuming the model covers all effects.[1]
Estimate the best possible benefit from the affected phase
If a request takes fifty milliseconds, with forty in data retrieval and ten in rendering, doubling rendering speed saves five milliseconds. Even eliminating rendering entirely saves at most ten under this serial model. See limits from a serial fraction.
Baseline 40 + 10 = 50 ms
Renderer becomes twice as fast: 40 + 5 = 45 ms
Renderer cost zero: idealized 40 ms
Recheck the measured phase when the workload changes
A large HTML response can have different cost proportions from a small one. Parallel or overlapping phases need critical-path reasoning. Measure normal inputs separately.