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
@@ -46,17 +47,13 @@ kotlinx-benchmark is a toolkit for running benchmarks for multiplatform code wri
46
47
-[Compatibility Guide](docs/compatibility.md)
47
48
-[Submitting issues and PRs](CONTRIBUTING.md)
48
49
49
-
## Using in Your Projects
50
-
51
-
The `kotlinx-benchmark` library is designed to work with Kotlin/JVM, Kotlin/JS, Kotlin/Native, and Kotlin/Wasm (experimental) targets.
52
-
To get started, ensure you're using Kotlin 1.9.20 or newer and Gradle 7.4 or newer.
53
-
54
-
### Project Setup
50
+
## Setting Up a Kotlin Multiplatform Project for Benchmarking
55
51
56
-
Follow the steps below to set up a Kotlin Multiplatform project for benchmarking.
52
+
To configure a Kotlin Multiplatform project for benchmarking, follow the steps below.
53
+
If you want to benchmark Kotlin/JVM or Java code, you may refer to our [comprehensive guide](docs/kotlin-jvm-project-setup.md)
54
+
dedicated to setting up benchmarking in those specific project types.
57
55
58
-
<detailsopen>
59
-
<summary>Kotlin DSL</summary>
56
+
<detailsopen><summary>Kotlin DSL</summary>
60
57
61
58
1.**Applying Benchmark Plugin**: Apply the benchmark plugin.
62
59
@@ -102,10 +99,9 @@ Follow the steps below to set up a Kotlin Multiplatform project for benchmarking
102
99
}
103
100
```
104
101
105
-
</details>
102
+
</details>
106
103
107
-
<details>
108
-
<summary>GroovyDSL</summary>
104
+
<details><summary>GroovyDSL</summary>
109
105
110
106
1. **ApplyingBenchmarkPlugin**:Apply the benchmark plugin.
111
107
@@ -151,7 +147,7 @@ Follow the steps below to set up a Kotlin Multiplatform project for benchmarking
151
147
}
152
148
```
153
149
154
-
</details>
150
+
</details>
155
151
156
152
### Target-specific configurations
157
153
@@ -195,8 +191,7 @@ To run benchmarks in Kotlin/JVM:
195
191
}
196
192
```
197
193
198
-
<details>
199
-
<summary><b>Explanation</b></summary>
194
+
<details><summary><b>Explanation</b></summary>
200
195
201
196
Assume that you've annotated each of your benchmark classes with `@State(Scope.Benchmark)`:
202
197
@@ -212,8 +207,8 @@ To run benchmarks in Kotlin/JVM:
212
207
}
213
208
```
214
209
215
-
In Kotlin, classes are `final` by default, which means they can't be overridden.
216
-
Thisis incompatible with the operation of the JavaMicrobenchmarkHarness (JMH), which kotlinx-benchmark uses under the hood for running benchmarks on JVM.
210
+
In Kotlin, classes are `final` by default, which means they can't be overridden.
211
+
Thisconflicts with the JavaMicrobenchmarkHarness (JMH) operation, which `kotlinx-benchmark` uses under the hood for running benchmarks on JVM.
217
212
JMH requires benchmark classes and methods to be `open` to be able to generate subclasses and conduct the benchmark.
218
213
219
214
Thisis where the `allopen` plugin comes into play. With the plugin applied, any classannotated with `@State` is treated as `open`, which allows JMH to work as intended:
@@ -311,7 +306,8 @@ To run benchmarks in Kotlin/Wasm:
311
306
}
312
307
```
313
308
314
-
Note:Kotlin/Wasmis an experimental compilation target forKotlin. It may be dropped or changed at any time.
309
+
Note:Kotlin/Wasmis an experimental compilation target forKotlin. It may be dropped or changed at any time. Refer to
310
+
[Kotlin/Wasm documentation](https://kotlinlang.org/docs/wasm-overview.html) for up-to-date information about the target stability.
315
311
316
312
### WritingBenchmarks
317
313
@@ -395,11 +391,11 @@ See [writing benchmarks](docs/writing-benchmarks.md) for a complete guide for wr
395
391
To run your benchmarks in all registered platforms, run `benchmark` Gradle task in your project.
396
392
To run only on a specific platform, run `<target-name>Benchmark`, e.g., `jvmBenchmark`.
397
393
398
-
For more details about the tasks created by the kotlinx-benchmark plugin, refer to [this guide](docs/tasks-overview.md).
394
+
For more details about the tasks created by the `kotlinx-benchmark` plugin, refer to [this guide](docs/tasks-overview.md).
399
395
400
396
### BenchmarkConfigurationProfiles
401
397
402
-
The kotlinx-benchmark library provides the ability to create multiple configuration profiles. The `main` configuration is already created by the Toolkit.
398
+
The`kotlinx-benchmark` library provides the ability to create multiple configuration profiles. The `main` configuration is already created by the toolkit.
403
399
Additional profiles can be created as needed in the `configurations` section of the `benchmark` block:
404
400
405
401
```kotlin
@@ -432,9 +428,9 @@ Refer to our [detailed documentation](docs/separate-benchmark-source-set.md) on
432
428
433
429
## Examples
434
430
435
-
To help you better understand how to use the kotlinx-benchmark library, we've provided an [examples](examples) subproject.
431
+
To help you better understand how to use the `kotlinx-benchmark` library, we've provided an [examples](examples) subproject.
436
432
These examples showcase various use cases and offer practical insights into the library's functionality.
437
433
438
434
## Contributing
439
435
440
-
We welcome contributions to kotlinx-benchmark!If you want to contribute, please refer to our [ContributionGuidelines](CONTRIBUTING.md).
436
+
We welcome contributions to `kotlinx-benchmark`!If you want to contribute, please refer to our [ContributionGuidelines](CONTRIBUTING.md).
0 commit comments