Additional results to benchmark

Joel Moberg joel.moberg at gmail.com
Mon May 16 15:30:16 UTC 2016


On Mon, May 16, 2016 at 4:52 PM, Jens Wilke <jw_list at headissue.com> wrote:

> 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
>

I was unsure when thinking about using a profiler. Now I can follow your
example. Thanks! This may be better because I can use it freely for any
benchmark suite. With what I suggested I believe reuse is limited to
extension classes.

Thanks,
Joel


>
> Cheers,
>
> Jens
>
> --
> "Everything superfluous is wrong!"
>
>    // Jens Wilke - headissue GmbH - Germany
>  \//  https://headissue.com
>


More information about the jmh-dev mailing list