4 ms·
Isn't the time for measurement usually after the code has been mostly written? Not prematurely optimizing means getting to the measurement point as soon as you
by dagheti 17y ago
Isn't the time for measurement usually after the code has been mostly written? Not prematurely optimizing means getting to the measurement point as soon as you can, then using actual profiling numbers to focus your attention on what needs to be changed.
- scott_s 17y agoNo, because then you may be locked into design choices that limit what you can optimize. If performance is important, experiment with the general idea of a design, and if its performance is acceptable, follow through. If you wait until everything is mostly written, you risk finding out that a fundamental design decision is causing your performance problems.
- dagheti 17y agoI guess the tricky part here is defining the term "mostly written". My mistake for introducing it (and of course the tautological 'don't prematurely optimize'). Agreed, you should measure as soon as you can and it's best to be building and measuring, not guessing where your bottlenecks are up front.