You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-5Lines changed: 23 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,7 +115,7 @@ For different platforms, there may be distinct requirements and settings that ne
115
115
116
116
#### Kotlin/JVM
117
117
118
-
When benchmarking Kotlin/JVM code with JavaMicrobenchmarkHarness (JMH), you should use the [allopen plugin](https://kotlinlang.org/docs/all-open-plugin.html). This plugin ensures your benchmark classes and methods are `open`, meeting JMH's requirements.
118
+
When benchmarking Kotlin/JVM code with JavaMicrobenchmarkHarness (JMH), you should use the [allopen plugin](https://kotlinlang.org/docs/all-open-plugin.html). This plugin ensures your benchmark classes and methods are `open`, meeting JMH's requirements. Make sure to apply the jvm plugin.
119
119
120
120
```kotlin
121
121
plugins {
@@ -161,7 +161,19 @@ This configuration ensures that your `MyBenchmark` class and its `benchmarkMetho
161
161
162
162
</details>
163
163
164
-
You can alternatively mark your benchmark classes and methods `open` manually, but using the `allopen` plugin enhances code maintainability.
164
+
You can alternatively mark your benchmark classes and methods `open` manually, but using the `allopen` plugin enhances code maintainability. For a practical example, please refer to [examples](examples/kotlin-kts).
165
+
166
+
#### Java
167
+
168
+
In order to conduct benchmarking inJava, you need to apply the Java plugin.
169
+
170
+
```kotlin
171
+
plugins {
172
+
id("java")
173
+
}
174
+
```
175
+
176
+
For a practical example, please refer to [examples](examples/java).
165
177
166
178
#### Kotlin/JS
167
179
@@ -180,9 +192,13 @@ For Kotlin/JS, only IR backend is supported. For more information on the IR comp
180
192
181
193
#### Multiplatform
182
194
183
-
For multiplatform projects, add the `kotlinx-benchmark-runtime` dependency to the `commonMain` source set:
195
+
For multiplatform projects, add the `kotlinx-benchmark-runtime` dependency to the `commonMain` source set, and be sure to apply the multiplatform plugin, as shown below:
184
196
185
197
```kotlin
198
+
plugins {
199
+
id("multiplatform")
200
+
}
201
+
186
202
kotlin {
187
203
sourceSets {
188
204
commonMain {
@@ -194,7 +210,7 @@ kotlin {
194
210
}
195
211
```
196
212
197
-
The platform-specific artifacts will be resolved automatically.
213
+
This setup enables running benchmarks in the main compilation of any registered targets. Another option is to register the compilation you want to run benchmarks from. The platform-specific artifacts will be resolved automatically. For a practical example, please refer to [examples](examples/multiplatform).
198
214
199
215
### BenchmarkConfiguration
200
216
@@ -290,9 +306,11 @@ benchmark {
290
306
}
291
307
```
292
308
309
+
For comprehensive guidance on configuring your benchmark setup, please refer to our detailed documentation on [Configuring kotlinx-benchmark](docs/configuration-options.md).
310
+
293
311
# Examples
294
312
295
-
The project contains [examples](https://github.com/Kotlin/kotlinx-benchmark/tree/master/examples) subproject that demonstrates using the library.
313
+
To help you better understand how to use the kotlinx-benchmark library, we've provided an [examples](examples) subproject. These examples showcase various use cases and offer practical insights into the library's functionality.
0 commit comments