Raw data output

Petr Stefan ptr.stef at gmail.com
Wed Jul 13 14:13:52 UTC 2016

Hi Aleksey,

thanks for your feedback.

Dne 12.7.2016 v 21:58 Aleksey Shipilev napsal(a):
>   *) Sign the OCA (http://openjdk.java.net/contribute/) as soon as
> possible -- processing takes time.
I did it today morning.

>   *) No need for a separate JSON formatter. Keeping both non-raw and raw
> versions in sync would be a hassle, so let's just fix the current JSON
> formatter.
Sure, but I'd like to discuss the format. There are some options:

- Print the raw data the same way as it's now. For most of the 
benchmarking modes the output remains the same, but for sample time mode 
it has (big) disadvantage in output file size because of huge amount of 
values (quite often repeated).

- Print the raw data as a pair of number and count. In JSON it should 
look like "[ 4296.0, 129 ] ", eq. 129 times value of 4296.0. It's little 
more space consuming for other modes, but for sample time it saves a lot.

- Print sample time mode differently than other modes. It's a little 
inconsistent, but probably not too much. Sample time mode will be 
printed in compact way, others will be printed with current format. For 
this, we'd need to split "rawData" key into two new keys like 
"rawDataSimple" and "rawDataCombined" and say that actual data are in 
one of this key, but not both (in which one depends on benchmarking mode).

These are basic options I've thought of. I'd probably pick second one. 
Maybe there is even better solution?

Another question - is it useful to have rawData values divided into 
multiple BenchmarkResult section? I'm talking about

"rawData" : [

What if all the values were just in single JSON array as in

"rawData" : [

It would be more compact and disk space saving. Maybe it is useful for 
something, but I don't see it now. However, preserve this formatting is 
quite easy.

>   *) We would need to be able to trim/disable raw_data printing in JSON
> output. The common way in JMH is to use system properties. Something
> like boolean "jmh.json.rawData" would be fine.
Default will be off?

Have a nice time. Cheers,


More information about the jmh-dev mailing list