Creating a benchmark, large as well as small, for an application without knowing much about the application behavior is a fairly futile exercise. In order to understand which benchmarks may be relevant for performance testing an application, the application needs to be well profiled.
There are several tools available for examining Java applications that either work by creating a special version of the application by inserting instrumentation code in the bytecode or through online analysis of an unmodified program. The JRockit Mission Control suite is an example of the latter. The next part of this book extensively explains how to use the JRockit Mission Control suite for profiling purposes.
Profiling an application will reveal things such as in which methods most of the run time is spent, common patterns in garbage collection, and which locks are often contended versus those that do not matter for overall performance.
Naturally, profiling or instrumenting...