by YCode · 9y ago · 0 comments
Premature optimization is the root of all evil.
The comment comes from a time when people would regularly do foul things like changing code similar to a switch/case into something that involves shoving an integer directly into a flags register or worse. (then you must add another case or port to different hardware... uh oh!)
Failure to think about performance from the beginning can get you in deep trouble. The worst case is when there is no bottleneck to be found by a profiler; instead there is slowness spread all throughout. This may force a total rewrite or abandonment of the project. Language choice is particularly prone to causing this, but habitual poor choices can mess you up just as badly.