Another crucial step to doing a benchmark is to not measure the data on a cold system. The reason is that a Java EE application generally intends to be long-running software; for that reason, it is common to have a hot system which already got optimizations after having ran during weeks or hours. These optimizations can be in action:
- The JVM Just-In-Time (JIT) compilation: This will optimize some common code paths. You can also investigate the -XX:-TieredCompilation option of the JVM to pre-compile the code, but you can encounter some issues with it on some servers.
- You can use some caching and therefore the application will be faster once the cache has all the data you test.
- If you use some external system you may ...