Skip to content

Commit 098f83f

Browse files
author
Abduqodiri Qurbonzoda
committed
Document jmhVersion and jsBenchmarksExecutor options
1 parent fc946ac commit 098f83f

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

docs/configuration-options.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,39 @@ The options listed in the following sections allow you to tailor the benchmark e
6969
- A positive integer value – the amount used for all benchmarks in this configuration.
7070
- **"definedByJmh"** – Let JMH determine the amount, using the value in the [`@Fork` annotation](https://javadoc.io/static/org.openjdk.jmh/jmh-core/1.21/org/openjdk/jmh/annotations/Fork.html) for the benchmark function or its enclosing class. If not specified by `@Fork`, it defaults to [Defaults.MEASUREMENT_FORKS (`5`)](https://javadoc.io/static/org.openjdk.jmh/jmh-core/1.21/org/openjdk/jmh/runner/Defaults.html#MEASUREMENT_FORKS).
7171

72+
The library offers the flexibility to specify the version of the Java Microbenchmark Harness (JMH) to use when running benchmarks on the JVM.
73+
The default version is set to `1.21`, but you can customize it while registering a JVM target for benchmarking:
74+
75+
```kotlin
76+
benchmark {
77+
targets {
78+
register("jvmBenchmarks") {
79+
this as JvmBenchmarkTarget
80+
jmhVersion = "1.36"
81+
}
82+
}
83+
}
84+
```
85+
86+
Alternatively, you can utilize the project property `benchmarks_jmh_version` to achieve the same effect.
87+
7288
### Kotlin/JS & Kotlin/Wasm
7389
| Option | Description | Possible Values | Default Value |
7490
|-----------------------------------------------|-------------------------------------------------------------------------------------------------------|-----------------|---------------|
7591
| `advanced("jsUseBridge", value)` | Generate special benchmark bridges to stop inlining optimizations. | `true`, `false` | `true` |
7692

77-
**Note:** In the Kotlin/JS target, the "jsUseBridge" option only takes effect when the `BuiltIn` benchmark executor is selected.
93+
**Note:** In the Kotlin/JS target, the "jsUseBridge" option only takes effect when the `BuiltIn` benchmark executor is selected.
94+
95+
By default, kotlinx-benchmark employs the `benchmark.js` library for running benchmarks in Kotlin/JS.
96+
However, users have the option to select the library's built-in benchmarking implementation:
97+
98+
```kotlin
99+
benchmark {
100+
targets {
101+
register("jsBenchmarks") {
102+
this as JsBenchmarkTarget
103+
jsBenchmarksExecutor = JsBenchmarksExecutor.BuiltIn
104+
}
105+
}
106+
}
107+
```

0 commit comments

Comments
 (0)