I find Google's micro benchmark project Caliper very interesting but the documentation is still (except some examples) quite non-existent.
I have two different cases where I need to influence the command line of the JVMs Caliper starts:
- I need to set some fixed (ideally alternated between a few fixed values) -D parameters
- I need to specify some fixed (ideally alternated between a few fixed values) JVM parameters
I saw some discussion about adding features like this but I could not conclude if it has been added or not and in that case what the syntax became?
Some example or pointers into Java doc (assuming this is at all documented somewhere) etc would be very much appreciated!
To fix a benchmark parameter with a command line argument, use
-Dname=value
. There is one special parameter namedbenchmark
; it's values are the suffixes to yourtime
methods. If you'd like to limit a parameter to multiple values, separate them by commas like this:-Dname=value1,value2
.To set JVM parameters, use
-Jname=flag1,flag2
.For example consider this benchmark:
To run this benchmark with lengths 5 and 6, and large and small heaps, use these parameters:
This yields the following: