Here's a Java performance tuning pattern I've used with great success before:
- Measure the performance of the Java application.
- Identify the location of any performance bottlenecks.
- Think of a hypothesis for the cause of the bottleneck.
- Create a test to isolate the factor identified by the hypothesis.
- Test the hypothesis.
- Alter the application to reduce the bottleneck.
- Test that the alteration improves the performance.
- Repeat from step 1.
While I'm at it, here's a figure that I used in a Java Performance Tuning seminar in 2004. This shows where profiling fits in with your regular application development lifecycle.
Credit for this figure belongs to whoever did "The Black Art of Benchmarking" at Java One in 2003. I think it was given by Timothy Cramer, Tom Marble, and Menasse Zaudou.