[Ext] How to measure a method multiple times with different parameter values
Vijay Lakshminarayanan
laksvij at hawk.iit.edu
Sun May 24 01:16:07 UTC 2020
Hi David
Is this what you're looking for:
https://hg.openjdk.java.net/code-tools/jmh/file/b6f87aa2a687/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_27_Params.java
More examples available at
https://hg.openjdk.java.net/code-tools/jmh/file/tip/jmh-samples/src/main/java/org/openjdk/jmh/samples/.
Thanks
Vijay
On Sun, May 24, 2020 at 12:29 AM David Karr <davidmichaelkarr at gmail.com> wrote:
>
> I want to benchmark the performance of a method that takes a parameter, a
> list of objects to be more specific. I can easily write a benchmark that
> creates a static list and write a benchmark that takes the body of the
> original method and references the static list.
>
> Instead of benchmarking a void method, I'd really like to benchmark the
> method that takes the list parameter, keeping the signature, and having it
> return the value.
>
> I would also like to run multiple benchmarks of the same method, but with
> different values sent to the method, mostly to test it with different list
> lengths.
More information about the jmh-dev
mailing list