Tutorials - Performance Guide J3D1.3. Make Java fast: Optimize! According to the pioneering computer scientist Donald Knuth, "Premature optimization is the root of all evil.
" Any article on optimization must start by pointing out that there are usually more reasons not to optimize than to optimize. If your code already works, optimizing it is a sure way to introduce new, and possibly subtle, bugsOptimization tends to make code harder to understand and maintainSome of the techniques presented here increase speed by reducing the extensibility of the codeOptimizing code for one platform may actually make it worse on another platformA lot of time can be spent optimizing, with little gain in performance, and can result in obfuscated codeIf you're overly obsessed with optimizing code, people will call you a nerd behind your back Before optimizing, you should carefully consider whether you need to optimize at all.
Optimization in Java can be an elusive target since the execution environments vary. PerformanceSummary. Java(tm) Optimization and Java Performance Tuning Techniques. This paper illustrates practical ways you can improve JavaTM performance, and presents 30 Java performance tuning and Java efficiency techniques.
These techniques focus on Java language and library features. Performance is defined to include both speed and space issues, that is, how to make your programs run faster, while using less memory and disk space. Many of the techniques are illustrated by code examples. The paper raises a variety of performance issues, and gives some hard numbers about how specific performance improvements work out.