Creating benchmarks "dynamically"
Kannan Goundan
kannan at cakoose.com
Wed Aug 24 18:52:38 UTC 2016
I'm setting up a framework for students to understand different "Map"
implementations.
The way it works:
- The student implements the Map interface in different ways (binary tree,
hashtable, etc)
- The "Impls" class has a public static mapping from implementation names
to implementation factory functions.
- There's a "Test" class with a "main" function. You pass in a list
implementation names on the command line and runs correctness testing on
them.
- There's a "Bench" class with a "main" function. You pass a list of
implementation names on the command line, along with the path to a file.
It runs benchmarks of all the implementations using the keys from that
file. This allows the student to quickly try out different sets of keys to
see how their implementation performs.
I'd like to use JMH to implement "Bench", but I can't figure out the right
way to do that. The list of implementations is dynamic (I just have a list
of factory functions) and the list of keys is also dynamic (read in from a
file).
Any ideas?
More information about the jmh-dev
mailing list