Java Performance Tuning, 2nd Edition
Published March 31, 2003
Review of ORA's 2nd Edition Java Performance Tuning
Overview
Performance has been the albatross around Java's neck for a long time. It's a popular subject when developers get together "Don't use Vector, use ArrayList, it's more efficient." "Don't concatenate Strings, use a StringBuffer, it's more efficient." It's a chance for the experienced developers to sit around the design campfire and tell ghost stories of previous projects where they implemented their own basic data structures {String, Linked List...} that was anywhere from 10-50% faster than the JDK implementation (and in the grand oral tradition of tall tales, it gets a little more efficient every time they tell it). Every developer has written a microbenchmark (a bit of code that does something 100-1000 times in a tight loop and measure the time it takes for the supposed "expensive operation") to try and prove an argument about which way is "more efficient" based on the execution time. The problem is when running in a dynamic, managed environment like the 1.4.x JVM, there more factors that you don't control than you do, and it can be dificult to say whether one piece of code will be "more efficient" than another without testing with actual usage patterns. This book provides substantial benchmarks (not just simple microbenchmaks) with thorough coverage of the JDK including loops, exceptions, strings, threading, and even underlying JVM improvements in the 1.4 VM. This book is one of a kind in its scope and completeness.
The Gory Details
The best part of this book is that it not only tells you how fast various standard Java operations are (sorting strings, dealing with exceptions, etc.), but he has kept all of the timing information from the previous edition of the book. This shows you how the VMs performance has changed from version 1.1.8 up to 1.4.0, and it's very clear that things are getting better. The author also breaks out the timing information for 3 different flavors of the 1.4.0 JVM: mixed interpreted/compiled mode (standard), server (with Hotspot), and interpreted mode only (no run time optimization applied).
PART 1 : LIES, DAMN LIES, AND STATISTICS
The book starts off with three chapters of sage advice about the tools and process of profiling/tuning. Before you spend any time profiling, you have to have a process and a goal. Without setting goals, the tuning process will never end and it will likely never be successful. The author outlines a general strategy that will give you a great starting point for your tuning task forces. Chapter 2 presents the profiling facilities that are available in the Java VM and how to interpret the results, while chapter 3 covers VM optimizations (different garbage collectors, memory allocation options) and compiler optimizations.
PART 2 : THE BASICS
- Java Performance Tuning, 2nd Edition
- Published: March 31, 2003
- Type:
- Section: Books
- Filed Under: Books: Computers and Internet
- Writer: Craig Pfeifer
- Craig Pfeifer's BC Writer page
- Craig Pfeifer's personal site
- Spread the Word
- Like this article?
- Email this
Save to del.icio.us



