Performance testing
When we implement object pooling in our Java applications, we want to do three things:
- Ensure our program works
- Prove that our implementation resulted in greater performance
- Quantify the optimization
In previous sections, we looked at how to implement object pools in Java. In this section, we will look at how to design a performance test, how to implement the object pooling performance test, and how to analyze the testing results.
Designing a performance test
After we decide to implement a performance test, our first action is to design the test. The questions we need to answer here include the following:
- What is our goal?
- What will we measure?
- How will we measure?
- What conditions will exist for our tests?
With these questions in mind, we can start designing our performance test. We should have a clear goal or set of goals for our performance test. We might, for example, want to focus on system memory, CPU...