I recommend you to use Java microbenchmarks (JMH https://openjdk.java.net/projects/code-tools/jmh/) and measure the performance of your Java code.
Results might be incorrect, when you just loop and do not use your str String. See also “Avoiding Benchmarking Pitfalls on the JVM” https://www.oracle.com/technetwork/articles/java/architect-benchmarking-2266277.html
As mentioned in the story (https://medium.com/@chrishantha/benchmarking-object-pools-6df007a31ada#a65a), I used Seaborn, which is a Python visualization library based on matplotlib to visualize the results.
The script is also available at my GitHub repository. See: https://github.com/chrishantha/object-pool-benchmarks/blob/v1.1.0/create-charts.py
Yes, being fair can reduce long tail latencies. How does it work in Stormpot Blaze Pool? Max sample time for Stormpot Blaze Pool is very high for some cases.
Thanks for your feedback. If this is an unexpected result, we should definitely investigate. Will you be able to check my benchmark code and results in https://github.com/chrishantha/object-pool-benchmarks/releases/tag/v1.1.0
I always got high throughput with Stormpot Blaze Pool when there are more threads.
Yes, that consumeCPU method should be dominating the benchmark and I added it assuming the latency cost is same for all object pools. As I explained in my story, I wanted to do some operations while keeping the object out of the pool (to simulate a real world scenario)