-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Documentation and automation for using JITWatch to analyse JMH benchmarks #7294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The best way to review/improve the PR would be to try to follow the instructions and see how far you get :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great! In other words, please share more of the tricks in your wizardry toolbox 😃
I'll give it a try. The test failure would go away after a rebase (#7289 (comment)).
test/benchmarks/README.md
Outdated
@@ -72,13 +72,74 @@ For an Oracle (or other compatible) JVM not set up by your distribution, | |||
you may also need to copy or link the disassembler library | |||
to the `jre/lib/`_`architecture`_ directory inside your JVM installation directory. | |||
|
|||
The JITWatch project has [hsdis build instructions](https://github.com/AdoptOpenJDK/jitwatch/wiki/Building-hsdis). | |||
One way to obtain HSDIS is to use [the binaries](https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/hsdis/intel/) which are used ing the [Graal build](https://github.com/oracle/graal/blob/master/compiler/mx.compiler/mx_graal_tools.py#L94-L119). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo "ing"
e7b6e33
to
a24df28
Compare
Very neat, can we expect an sbt-jitwatch ? :) |
I'll push this up to sbt-jmh once it stabilizes a bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked for me! 👍
@@ -72,13 +72,74 @@ For an Oracle (or other compatible) JVM not set up by your distribution, | |||
you may also need to copy or link the disassembler library | |||
to the `jre/lib/`_`architecture`_ directory inside your JVM installation directory. | |||
|
|||
The JITWatch project has [hsdis build instructions](https://github.com/AdoptOpenJDK/jitwatch/wiki/Building-hsdis). | |||
One way to obtain HSDIS is to use [the binaries](https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/hsdis/intel/) which are used in the [Graal build](https://github.com/oracle/graal/blob/master/compiler/mx.compiler/mx_graal_tools.py#L94-L119). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For macOS there are currently two files there: hsdis-amd64-darwin-67f6d23cbebd8998450a88b5bef362171f66f11a.dylib
and hsdis-amd64-darwin-fdb13ef0d7d23d93dacaae9c98837bea0d4fc5a2.dylib
. I usesd the fdb13...
version, which seems to work, didn't try the other. Also I had to rename it to hsdis-amd64.dylib
to make it work (and put it int the jre/lib/server
directory).
task in our build: | ||
|
||
``` | ||
sbt> bench/jmh:jitwatchConfigFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sbt logs an error for me
sbt:root> bench/jmh:jitwatchConfigFile
[error] local: bad info.apiURL found in /Users/luc/.ivy2/local/org.scala-lang/scala-reflect/2.13.0-pre-SNAPSHOT/ivys/ivy.xml: expected='http://www.scala-lang.org/api/2.13.0-pre-SNAPSHOT/' found='null'
and then
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang#scala-reflect;2.13.0-pre-SNAPSHOT: java.text.ParseException: inconsistent module descriptor file found in '/Users/luc/.ivy2/local/org.scala-lang/scala-reflect/2.13.0-pre-SNAPSHOT/ivys/ivy.xml': bad info.apiURL found in /Users/luc/.ivy2/local/org.scala-lang/scala-reflect/2.13.0-pre-SNAPSHOT/ivys/ivy.xml: expected='http://www.scala-lang.org/api/2.13.0-pre-SNAPSHOT/' found='null';
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
but the generated file works nevertheless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to get rid of that.
a24df28
to
ff1e641
Compare
ff1e641
to
a2de76f
Compare
I found JITWatch really useful to drill into regressions in
HashMap
performance recently, but its a pain to configure manually.This PR automates the generation of a config file containing the sources (including source JARs of dependencies) and classes (including dependency JARs).
Instructions
(These are also in the benchmark
README.md
)You can generate the
hotspot.log
file for a benchmark run by adding the required JVM optionsto JMH benchmark execution:
JITWatch requires configuration of the class and source path. We can generate that with a custom
task in our build:
Build jitwatch.
Launch with the generated config file.