Updated on 2025-05-22 GMT+08:00

PERF05 Performance Optimization

In performance optimization, avoid "premature optimization". Our basic strategy is to first make the system work, then consider how to make it faster. Optimization should generally only be undertaken when we have confirmed a performance bottleneck in specific code sections. Unless specialized tools identify the bottleneck, such efforts may prove wasteful. Additionally, the hidden cost of optimization, that is, reduced code clarity and maintainability, must be carefully weighed.