预计阅读本页时间:-
Measure before Optimizing
Prev Chapter�燨ptimization Next
Measure before Optimizing
广告:个人专属 VPN,独立 IP,无限流量,多机房切换,还可以屏蔽广告和恶意软件,每月最低仅 5 美元
When you have real-world evidence that your application is too slow, then (and only then) is the time to think about optimizing the code. But before you do more than think about optimizing, measure.
The natural smoothing of the data that results from model fitting tends to focus on the big effects and cover up the small, noisy ones. For example, by fitting a cubic to the matrix inversion routine in MATLAB on random matrices from 10 � 10 to 1000 � 1000, it is clear that we actually have three cubics, with clearly defined boundaries, that correspond roughly to “in cache”, “in memory but out of cache”, and “out of memory”. The data shows us this effect even if weren't looking for it, just by looking at the deviations from the best fit.
-- Steve Johnson
Don't Just Do Something, Stand There! Home 燦onlocality Considered Harmful