How to optimize your Java programs so that they're faster, smaller, and more maintainable.
- Benchmarks: costs of Java operations.
- Compilers: what they can and can't do.
- Maintainability: how to make your code easier to understand.
- Resources: other places you can go for help.
- Rules: general guidelines for optimization
- Size: how to make your code smaller.
- Speed: how to make your code faster.
- Tools: software that can help you optimize Java.
March 18th, 1998May 26th, 1997
- As you've probably guessed by now, I've retired this site. After this final update of ten months' worth of email(!), I won't be making any further changes. Sorry for leaving things hanging, but I've moved on to a new job.
- Pruned all the bad links that I could find.
- Speed: more on reusing objects, avoiding expensive Java constructs and data structures, and the two types of switch.
- Linpack: why the optimized version is slower under modern JITs.
- Compilers: commercial source-code optimizer.
- Size: commercial byte-code obfuscator.
- Tools: commercial profiler.
May 14th, 1997
- Speed: another JIT, this time for HP-UX.
See also previous updates.
- I swear it doesn't seem like two months since I last touched these pages. A PhD thesis will do that to you...
- Maintainability: four sets of coding style guidelines, avoiding gray areas of the Java spec, watching for incompatible code, and using good tools.
- Resources: links to other benchmarks, and another Java games book with optimization references.
- Size: another code obfuscator.
- Speed: list of available just-in-time compilers.
- Tools: another profile analyzer.
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
- M.A. Jackson
"More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity."
- W.A. Wulf
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil."
- Donald Knuth
"The best is the enemy of the good."
- Voltaire
| http://www.cs.cmu.edu/~jch/java/optimization.html | Java Optimization |
| Last modified: Tue 29 Apr 2003 | Copyright © 1996, 1997 Jonathan Hardwick |