I seem to notice two schools of thought emerging in regards to optimization:
On the face of things, they seem to be fairly opposed viewpoints. The thing is, I see the merit in both schools of thought. I can also think of times when both of these ways of thinking have helped me write better and faster software.
Is there any way to reconcile these two ideas? Is there a middle ground? Is there a time when one idea is the best tool for the job? Or am I presenting a false dichotomy and both views can co-exist peacefully?
Premature optimization, at the microscopic level, is usually a bad idea. This does not suggest, however, that engineers should not be concerned about application performance. The fallacy that "premature optimization" is the same thing as "concern about performance" should not guide software development.
Avoid premature optimization by getting user feedback early and often from your users. If you need help optimizing the performance of your application, be sure to check out our offerings. Prefix can help you find performance problems as you write your code.
"Premature optimization" is a phrase used to describe a situation where a programmer lets performance considerations affect the design of a piece of code.
Although Knuth popularized this concept, it has also been attributed to others, including Tony Hoare and Edsger Dijkstra, and Knuth himself referred to the statement “premature optimization is the root of all evil” as Hoare's dictum in 1989. However, evidence suggests that Knuth is the one who coined the phrase.
Optimise at the design and architecture level early on. Micro-optimise at the implementation level later.
You need to be aware of the performance costs of design decisions you make which will be hard to change later. Implementation can often be tuned later on, which is why it's not worth doing it until you know that it's a problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With