Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
minwoox committed Sep 9, 2023
1 parent 8e5adc9 commit 245ad46
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions benchmarks/jmh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

A collection of JMH benchmarks which may be useful for measuring Central Dogma performance.

## Limitation

- MacOS profiling is limited to user space code only, thus this guide does not cover profiling on MacOS.

## Options

- `-Pjmh.includes=<pattern>`
Expand Down Expand Up @@ -36,28 +32,32 @@ A collection of JMH benchmarks which may be useful for measuring Central Dogma p

## Retrieving flame graph using async-profiler

Allow running `perf` as a normal user

```
# echo 1 > /proc/sys/kernel/perf_event_paranoid
# echo 0 > /proc/sys/kernel/kptr_restrict
```

Install [async-profiler](https://github.com/jvm-profiling-tools/async-profiler):

```
$ cd "$HOME"
$ git clone https://github.com/jvm-profiling-tools/async-profiler.git
$ cd async-profiler
$ make
```
- Allow running `perf` as a normal user on Linux:
```
# echo 1 > /proc/sys/kernel/perf_event_paranoid
# echo 0 > /proc/sys/kernel/kptr_restrict
```
- MacOS profiling is limited to user space code only, thus this does not work with MacOS.

When running a benchmark, specify `-Pjmh.profilers` option:
- Install [async-profiler](https://github.com/jvm-profiling-tools/async-profiler):
```
$ cd "$HOME"
$ git clone https://github.com/jvm-profiling-tools/async-profiler.git
$ cd async-profiler
$ make
```

```
$ ./gradlew :benchmarks:jmh:jmh \
"-Pjmh.profilers=async:libPath=$HOME/async-profiler/build/lib/libasyncProfiler.so;output=flamegraph;dir=$HOME/result"
```
- When running a benchmark, specify `-Pjmh.profilers` option:
- On Linux
```
$ ./gradlew :benchmarks:jmh:jmh \
"-Pjmh.profilers=async:libPath=$HOME/async-profiler/build/lib/libasyncProfiler.so;output=flamegraph;dir=$HOME/result"
```
- On MacOS
```
$ ./gradlew :benchmarks:jmh:jmh \
"-Pjmh.profilers=async:libPath=$HOME/async-profiler/build/lib/libasyncProfiler.dylib;output=flamegraph;dir=$HOME/result"
```
## Notes
Expand Down

0 comments on commit 245ad46

Please sign in to comment.