PROJET AUTOBLOG


Shaarli - Les discussions de Shaarli

Archivé

Site original : Shaarli - Les discussions de Shaarli du 23/07/2013

⇐ retour index

The Fallacy of Premature Optimization

mercredi 23 septembre 2015 à 13:12
Httqm's Links
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil."
==> Small efficiencies aren't worth the effort during the initial design and implementation of a system, about 97% of the time.

What Hoare and Knuth are really saying is that software engineers should worry about other issues (such as good algorithm design and good implementations of those algorithms) before they worry about micro-optimizations such as how many CPU cycles a particular statement consumes.

So how does an inexperienced programmer learn when early optimization is appropriate? The first step is to profile everything; only by timing sections of the program can a programmer learn to predict the performance of similar code segments.

"Design first, code second." Systems that are designed without any thought of performance rarely perform well, even with an extensive optimization phase at the end of the software development cycle.
(Permalink) (Profil)