Most read:
Popular archives:
JavaWorld's new look is here!
We've upgraded the site with a fresh look-and-feel, improved topical navigation, better search, new features, and expanded
community platform. Learn more about the changes to JavaWorld.
| Oracle Compatibility Developer's Guide |
| The Explosion in DBMS Choice |
Part of the problem with Java performance is the JVM and compiler technology that comprise a portion of the platform. That is, interpreted languages are inherently slower than compiled native execution. Over the last four years, the Java platform's performance has improved with the advent of JIT (just-in-time) compiler technology, improved garbage collection, adaptive compilation, and the greater speed of underlying hardware. However, the advances in speed have in part been offset by the complexity of the Java applications that are being developed. The speed of the Java platform is actually increasing while developers are designing applications that require more complexity, speed, and scalability. Some issues that are labeled as Java performance problems are actually design problems that have nothing to do with Java.
Java platform performance will continue to improve in light of the competition from various vendors that produce JVMs, JIT compilers, and performance tools. Given the performance landscape, developers aren't freed from using sound and tested programming techniques. Poorly designed code will always execute slowly, regardless of how many variables are hidden in hardware registers or how many loops are unrolled.
Developers have sole responsibility for designing code that produces the smallest amount of bytecode and that executes as fast as possible. With any optimization technique, the key is to understand that using the technique in a vacuum may not improve performance noticeably. But the combination of several optimization techniques can produce significant performance gains.
Before diving into specific optimization techniques, here are some basic heuristics to remember regarding optimizing code:
Design problems typically spring up because developers need to produce speedy code. Moreover, in their haste, they can neglect solid design principals for perceived (and unrealized) performance improvements. This might result in faster code, but it will also produce inefficient code and designs that lack robustness and extensibility. The bigger issue is this: applications designed in this manner require that developers predict potential performance problems without the benefit of the working code that produces measurable execution paths.