microoptimization
Microoptimization refers to making small, localized code changes aimed at reducing the time or resources a program uses in its most frequently executed paths. It focuses on optimizing tiny sections of code, typically after profiling identifies a hot spot, and is usually distinguished from larger-scale algorithmic or architectural improvements.
The standard approach is to profile the program to locate bottlenecks, then target only those hot paths.
Common techniques address data locality, allocations, and simple operations inside tight loops. Examples include making memory
Trade-offs are central to microoptimization. Benefits can come at the cost of readability, maintainability, and portability.