Improvement suggestion for Iteration printout.

Jens Wilke jw_list at headissue.com
Sun Jun 19 11:31:18 UTC 2016


On Saturday 18 June 2016 08:48:56 Zoltan Farkas wrote:
> Would it be possible to synchronize on the stdout when printing:
> 
> Iteration   2: 72664.450 ops/s
> 
> so that in case there is other output enabled, the line will not get interleaved like:
> 
> Iteration   2:
> 
> Bla bla bla 
> 
>  72664.450 ops/s

"Iteration 2" gets printed before iteration starts and "ops/s" after the iteration is finished.
Everything the iteration code prints, is printed in between.

One possible solution would be to print two lines per iteration, like:

Iteration 2 running ...
Finished itaration 2: 72664.450 ops/s

A variant could be to print the first line only with a CR, so when finished and no output
happened in between the second line overwrites the first.

Ultimately, I think the best way is to have a command line option for this. There are two
different extremes here:

- simple (real?) micro benchmarks => a compact one line for each iteration
- verbose benchmark code => 2 lines with start and finish message for each iteration

Cheers,

Jens

-- 
"Everything superfluous is wrong!"

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


More information about the jmh-dev mailing list