Fwd: Re: FW: Basic JMH questions
Kenneth Fogel
kfogel at dawsoncollege.qc.ca
Thu Aug 22 17:15:21 UTC 2024
Thank you all for the info.
Ken
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: jmh-dev <jmh-dev-retn at openjdk.org> on behalf of Nitsan Wakart <nitsanw at yahoo.com>
Sent: Saturday, August 17, 2024 11:45:08 AM
To: Bernd Eckenfels <ecki at zusammenkunft.net>; jmh-dev at openjdk.org <jmh-dev at openjdk.org>
Subject: Re: Fwd: Re: FW: Basic JMH questions
Thanks for the honourable mention :-)
I’m not sure my posts are still up to date, but the samples in the jmh repo are excellent.
There’s a talk from Shipilev on JMH, and many of his blog posts provide larger examples of how to apply JMH to a given problem.
On Saturday, August 17, 2024, 1:02 AM, Bernd Eckenfels <ecki at zusammenkunft.net> wrote:
Hi Ken,
Yes JMH has Javadoc especially on API and Annotations, here for example on @Fork
https://javadoc.io/doc/org.openjdk.jmh/jmh-core/latest/org/openjdk/jmh/annotations/Fork.html
There is however not an official render of the doc, so I always run the maven goal myself on jmh-core.
Warmups are per Fork fork each test, there can also be Warmup Forks or batche warmups.
When running rough tests with larger execution times warmups sometimes overshoot and sometimes using too little warmups also can be an issue, so for the impatient tuning them down helps (more shorter says more about variance). For measures that count I also calculate the number of calls for the iterations to makes sure it gets into hot code terretory (jmh does not warn you)
I learned most about JMH from the official samples they have explaining comments and from Alexeis and Nitsans posts
http://psy-lob-saw.blogspot.com/p/jmh-related-posts.html
jmh.stack.period controls the stack sampling profiler, not sure if it’s worth spending time on it, period in ms!
https://github.com/openjdk/jmh/blob/fedf7639176ea2b3e521950777808701e2c5cc1a/jmh-core/src/main/java/org/openjdk/jmh/profile/StackProfiler.java#L81
Gruss
Bernd
Kenneth Fogel wrote on 16. Aug 2024 20:45 (GMT +02:00):
> (I may have used the wrong email address earlier today so sending this
> again)
I think there is no user mailing list but I we keep the banter lo we might fly under the radar :)
> If there is a better mailing list to ask my questions about the JMH then
> please let me know.
,,,,,
> The first most obvious question is if there are JavaDocs.
,,,
> When is a new JVM spun up for testing? Does it happen for every fork,
,,,
> What does this option mean:
> .jvmArgsAppend("-Djmh.stack.period=1") mean
Gruß
Bernd
—
https://bernd.eckenfels.net<https://bernd.eckenfels.net/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jmh-dev/attachments/20240822/cea86fb0/attachment-0001.htm>
More information about the jmh-dev
mailing list