Additional results to benchmark

Jens Wilke jw_list at headissue.com
Mon May 16 14:52:21 UTC 2016


Hi Joel,

On Monday 16 May 2016 13:12:08 Joel Moberg wrote:
> I am bench-marking a parallel algorithm where I sacrificed some precision
> for lower execution time. Now I would like to add a precision score to the
> benchmark output. It seems that it is more convenient to add these results
> and use same output. I am already using the output to plot results.
> 
> I have read the samples but can not find code that do this. Would it be
> possible to pass a Result instance to a tear-down phase? In this way at
> Level.Iteration, you can access IterationResult; at Trail, BenchmarkResult.

I stepped on this problem too and couldn't find a solution for this.

Thankfully, JMH is extensible! My work around was to write an own profiler 
implementation to add arbitrary results to the benchmark. It is here:

https://github.com/cache2k/cache2k-benchmark/blob/master/jmh-suite/src/main/java/org/cache2k/benchmark/jmh/MiscResultRecorderProfiler.java

It needs to be enabled with:
-prof org.cache2k.benchmark.jmh.MiscResultRecorderProfiler

Cheers,

Jens

-- 
"Everything superfluous is wrong!"

   // Jens Wilke - headissue GmbH - Germany
 \//  https://headissue.com


More information about the jmh-dev mailing list