We should forget about small inefficiencies, say about 97% of the time: premature optimization is the root of all evil.
~ Donald Ervin Knuth (born: 1938-01-10 age: 75)
A fast program is not as important as a correct one.
~ Steve McConnell
The only result of optimization you can usually be sure of without measuring performance is that you’ve made your code harder to read.
~ Steve McConnell
Jackson’s rules of Optimization:~ M.A. Jackson
- Don’t do it.
- (For experts only) Don’t do it yet — that is until you have a perfectly clear and unoptimized solution.
You can speed up a program by wasting even more cycles with progress bars and animated spinners — the approach pioneered by Microsoft.
If the program behaves what appears to behave like a reluctant or lazy human, it will be perceived as slow. If a program appears industrious, it can actually be a pig and get away with it.
In GUI s, what most often counts most is some sort of rapid acknowledgement feedback not the total elapsed time of some process.
Modern compilers and run times to some pretty spectacular optimisation without you having to do any work. For example, code that is not marked final will be inlined. Only later of some overriding class is loaded wil the inlining be dynamically undone. Jet does loop versioning. If you had a loop that for example kept checking if it were an odd or even interation, Jet would split the code into two versions, one for odd and one for even, and do the test only once at the top.
Optimisations I would like to see:
![]() |
recommend book⇒Code Complete: A Practical Handbook of Software Construction | |||
| by | Steve McConnell | 978-1-55615-484-3 | paperback | |
|---|---|---|---|---|
| publisher | Microsoft | 978-0-7356-3697-2 | eBook | |
| published | 1993-05-14 | |||
| Gives lots of practical advice on optimising. He talks mostly about C with examples in Fortran, Pascal, Basic and Ada. He doesn’t talk about Java. It didn’t exist when the book was written. | ||||
| Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. | ||||
![]() |
recommend book⇒Java Performance Tuning, second edition | |||
| by | Jack Shirazi | 978-0-596-00377-7 | paperback | |
|---|---|---|---|---|
| publisher | O’Reilly | |||
| published | 2003-01-21 | |||
| Recommended. O’Reilly Safari book available to read online for a fee. Includes tuning EE, JDBC, servlets and JSPs, and EJBs. Make sure you get the second edition (or later). | ||||
| Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. | ||||
![]() |
recommend book⇒Java Platform Performance: Strategies and Tactics | |||
| by | Steve Wilson, Jeff Kesselman | 978-0-201-70969-8 | paperback | |
|---|---|---|---|---|
| publisher | Prentice Hall | |||
| published | 2000-06-10 | |||
| Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. | ||||
![]() |
recommend book⇒Enterprise Java Performance | |||
| by | Steven L. Halter, Steven J. Munroe | 978-0-13-017296-9 | paperback | |
|---|---|---|---|---|
| publisher | Prentice Hall | |||
| published | 2000-08 | |||
| Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. | ||||
![]() |
recommend book⇒Sun Performance and Tuning: Java and the Internet, second edition | |||
| by | Adrian Cockcroft, Richard Pettit, Sun Microsystems | 978-0-13-095249-3 | paperback | |
|---|---|---|---|---|
| publisher | Prentice Hall | |||
| published | 1998-04-17 | |||
| Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. | ||||
![]() |
recommend book⇒Java ™ Puzzlers: Traps, Pitfalls, and Corner Cases | |||
| by | Joshua J. Bloch, Neal Gafter | 978-0-321-33678-1 | paperback | |
|---|---|---|---|---|
| birth | 1961-08-28 age: 51 | 978-0-321-64351-3 | eBook | |
| publisher | Addison-Wesley | B001U5VJVS | kindle | |
| published | 2005-07-04 | |||
| A set of 95 short programs that give astonishing results. When you understand them, you understand the quirkier features of Java. Bloch wrote much of the JDK class library. He also wrote the Effective Java Programming Language Guide | ||||
| Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. | ||||
![]() |
recommend book⇒Effective Java: second edition | |||
| by | Joshua J. Bloch | 978-0-321-35668-0 | paperback | |
|---|---|---|---|---|
| birth | 1961-08-28 age: 51 | 978-0-13-277804-6 | eBook | |
| publisher | Prentice Hall | B000WJOUPA | kindle | |
| published | 2008-05-28 | |||
| No design patterns, just generic advice on good Java programming style. This is considered the best explanation of generics, even though it has just one chapter on generics. People claim it all came clear after reading his explanation. It is also consider the best explanation of serialization. Not to be confused with his eariler Effective Java Programming Language Guide. book website | ||||
| Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. | ||||
|
|
available on the web at: |
http://mindprod.com/jgloss/optimising.html |
optional Replicator mirror
|
J:\mindprod\jgloss\optimising.html | |
![]() |
Please email your
feedback for publication,
letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear
wording, broken/redirected link reports, suggestions to improve this page or comments to
Roedy Green :
| |
| Blog | Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[54.234.231.49] |
|
| Feedback | You are visitor number 15,198. | |