jmh


JMH: Constrain parameter space


Suppose I have a JMH test with two parameters:
#Param( { "1", "2", 4", "8", "16" } )
int param1;
#Param( { "1", "2", 4", "8", "16" } )
int param2;
Is there an idiomatic way to add a constraint on the parameters, e.g. only to benchmarks for param1 < param2?
Throwing an exception from an #SetUp works, but adds noise to the output.
Nope, not at this point. If you feel the annotations are constraining, you can always fall back to the API. There, you can do something like:
for (int p1 = 1; p1 <= 16; p1 *= 2) {
for (int p2 = 1; p2 <= p1; p2 *= 2) {
Options opt = new OptionsBuilder()
...
.param("param1", p1)
.param("param1", p2)
.build();
RunResult r = new Runner(opt).runSingle();
... put r somewhere to process
}
}
(Maintainer's perspective: it does not seem worthwhile to wind up a full-fledged annotation-based DSL for JMH, it's just simpler to let users code their advanced scenarios in Java).
UPD: Come to think about it, you can probably encode both parameters into a single #Param, if you want to stay with the annotation-only way.

Related Links

How to make JMH run in less time
JMH objects outside a method scope
JMH measurement iterations
JMH - why do I need Blackhole.consumeCPU()
JMH setup and tear down
Benchmark results ForkJoin vs Disruptor?
JMH: Constrain parameter space
JMH: What does the score value mean?
Graphics + Archiving

Categories

HOME
http
kendo-ui-angular2
swift3
popover
app-store
coordinates
ms-application-insights
handlebars.js
wavefront
runtime
jcodemodel
aws-sdk-cpp
guidewire
internet-explorer-7
samba
views
hl7-fhir
bootstrap-datetimepicker
google-drive-android-api
procedural-generation
advertising
bootstrap-accordion
android-xml
my.cnf
suitescript
utc
gulp-jshint
drombler-fx
csproj
openoffice-impress
foxpro
voyager
minitest
outlook-2010
form-fields
libzip
jks
infovis
google-chrome-storage
easyquery
rivets.js
spring-cloud-bus
jcs
dotnet-cli
visualizer
nls
hdr
rowname
cherry-pick
calc
alchemy
markerspiderfier
google-finance-api
ios8-share-extension
android-togglebutton
avrcp
polarion
clearquest
genero
veeam
autopep8
xcode5
drools-guvnor
illegalargumentexception
famous-engine
tigase
debuggervisualizer
sendy
opencobol
node-mongodb-native
facebook-java-api
mongoid4
codio
node-amqp
grunt-contrib-imagemin
tlbimp
nokogiri
typography
wpd
kademlia
system.transactions
microsoft-speech-platform
cryptarithmetic-puzzle
mail-gem
sup
automapper-2
backlight
cpack
noise-reduction
s60
viewdata
xcdatamodel
datarelation
mediastreamsource
p4.net
web-widget
morfik
file-storage
authkit
jettison

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile