![]() |
recommend book⇒The Art of Computer Programming | |
| hardcover | ||
|---|---|---|
| ISBN13: | 978-0-201-48541-7 | |
| publisher: | Addison-Wesley | |
| published: | 1998-10-15 | |
| by: | Donald Knuth | |
| Knuth’s volumes 1, 2 and 3 are the reference works for standard algorithms. At his website he describes plans for volumes 4 and 5. | ||
Premature optimisation is the root of all evil.
~ Donald Ervin Knuth (born: 1938-01-10 age: 71)
The problem is fussing over fine detail to optimise wastes time and obscures the algorithm. Optimisation should be confined to choosing a good algorithm on the first pass. Only after the code is working should you fret over optimisation. Then, only if it needs it, determine the bottlenecks by measurement and fix only those.
Don’t do optimisations the compiler will do for you. That just clutters your code.
People often misapply the nostrum to imply that optimisation itself is evil. Only premature optimisation is.
| You can get the freshest copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) | |
| http://mindprod.com/jgloss/knuth.html | J:\mindprod\jgloss\knuth.html | |
![]() | ||
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view Blog | Your face IP:[38.107.191.105] | |
| Feedback | You are visitor number 9,900. | |