The 90/10 rule is a practical optimization heuristic: roughly 90 percent of an application's execution time is spent in roughly 10 percent of its code. It points optimization toward measured hotspots rather than evenly distributing effort across the codebase. section 1.3.3 section 12.3.2
Apply the rule as part of a measured optimization process:
- Set a specific performance target instead of asking generally for the application to become faster. section 12.3.2
- Establish baseline performance and profile the application to locate where it spends time. section 1.3.3 section 12.3.2
- Optimize the small portion consuming most of the time, then profile again to verify the change. section 1.3.3 section 12.3.2
- Balance small performance gains against added complexity, and stop when the application is fast enough to ship. section 1.3.3 section 12.3.2
A measured optimization loop
An application needs to run faster, but its requirement is not yet precise. Define the relevant performance metric, measure the current baseline, and profile execution. If the measurements identify a small area consuming most of the time, concentrate optimization there and measure again. If the target is reached, stop; otherwise, compare the gain with the complexity introduced by further changes. Infrastructure changes, such as a faster computer, more bandwidth, or a higher-capacity database, may offer a less expensive alternative. section 1.3.3 section 12.3.2
