Skip to content
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

Setup JHM profiler #50

Open
mcpiroman opened this issue Sep 9, 2021 · 8 comments · May be fixed by #217
Open

Setup JHM profiler #50

mcpiroman opened this issue Sep 9, 2021 · 8 comments · May be fixed by #217
Assignees
Labels
enhancement New feature or request

Comments

@mcpiroman
Copy link

For Jvm-only setup, can I use profiler as described in https://github.com/openjdk/jmh/blob/master/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_35_Profilers.java?

@elect86
Copy link

elect86 commented Dec 14, 2021

Any news on this?

@max-kammerer
Copy link

max-kammerer commented Dec 15, 2021

@mcpiroman @elect86 Could you clarify your questions?
There is simple example with JMH https://github.com/Kotlin/kotlinx-benchmark/blob/master/examples/java/, maybe it could answer your question?

@elect86
Copy link

elect86 commented Dec 15, 2021

Nope, this is what we'd like

@max-kammerer
Copy link

@elect86 Sorry, but pointing to line doesn't explain your problem and difficulties. Could you explain them?

@elect86
Copy link

elect86 commented Dec 16, 2021

Ok, I'll try to explain better.

From the main docs in the sample

JMH has a few very handy profilers that help to understand your benchmarks. While
these profilers are not the substitute for full-fledged external profilers, in many
cases, these are handy to quickly dig into the benchmark behavior. When you are
doing many cycles of tuning up the benchmark code itself, it is important to have
a quick turnaround for the results.

Among these, there is for example one regarding the GC. You can use it by passing -prof gc on the cli.
It'll print something like here:

Benchmark Mode Cnt Score Error Units

ScalarReplacement.single avgt 15 1.919 ± 0.002 ns/op
ScalarReplacement.single:·gc.alloc.rate avgt 15 ≈ 10⁻⁴ MB/sec
ScalarReplacement.single:·gc.alloc.rate.norm avgt 15 ≈ 10⁻⁶ B/op
ScalarReplacement.single:·gc.count avgt 15 ≈ 0 counts

It's useful to check, for example, if the EA kicks in and helps avoiding allocations

I'd like to have the possibility to set it in kotlinx-benchmark as well. I tried param and advanced, but it didn't work

@max-kammerer
Copy link

@elect86 Thank you for clarification! I hope @qurbonzoda could answer your question after coming back from vacation

@guohao
Copy link
Contributor

guohao commented Jan 4, 2022

Profiler is a very important feature for JMH users, hope to support soon :)

@qurbonzoda
Copy link
Collaborator

qurbonzoda commented Jan 12, 2022

Hi everyone,
You can still run a specific profiler (-prof <profiler>) by running the jar file that the <target>BenchmarkJar task generates. The generated jar file is located under the build/benchmarks/<target>/jars directory.

Currently, there is no way to define a profiler in the configuration script. Would a configuration option be helpful for you?

OndrejSliva pushed a commit to OndrejSliva/kotlinx-benchmark that referenced this issue Jan 10, 2024
…n-1.35

build(deps): bump jmh.version from 1.34 to 1.35
@qurbonzoda qurbonzoda linked a pull request May 23, 2024 that will close this issue
@qurbonzoda qurbonzoda added the enhancement New feature or request label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants