Skip to content

Commit a72f09d

Browse files
author
Abduqodiri Qurbonzoda
committed
Improve README.md and update version usages to 0.2.0-dev-20
1 parent 139397f commit a72f09d

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ the hoods to run benchmarks on JVM.
1414

1515
# Requirements
1616

17-
Gradle 5.1 or newer
18-
Kotlin 1.3.40 or newer
17+
Gradle 6.0 or newer
18+
19+
Kotlin 1.4.0 or newer
1920

2021
# Gradle plugin
2122

@@ -34,7 +35,7 @@ Use plugin in `build.gradle`:
3435

3536
```groovy
3637
plugins {
37-
id 'kotlinx.benchmark' version "0.2.0-dev-2"
38+
id 'kotlinx.benchmark' version "0.2.0-dev-20"
3839
}
3940
```
4041

@@ -47,7 +48,7 @@ buildscript {
4748
maven { url 'https://dl.bintray.com/kotlin/kotlinx' }
4849
}
4950
dependencies {
50-
classpath "org.jetbrains.kotlinx:kotlinx.benchmark.gradle:0.2.0-dev-2"
51+
classpath "org.jetbrains.kotlinx:kotlinx.benchmark.gradle:0.2.0-dev-20"
5152
}
5253
}
5354
@@ -67,6 +68,14 @@ kotlin {
6768

6869
For Kotlin/JVM code, add `allopen` plugin to make JMH happy. Alternatively, make all benchmark classes and methods `open`.
6970

71+
For example, if you annotated each of your benchmark classes with `@State(Scope.Benchmark)`:
72+
```kotlin
73+
@State(Scope.Benchmark)
74+
class Benchmark {
75+
76+
}
77+
```
78+
and added the following code to your `build.gradle`:
7079
```groovy
7180
plugins {
7281
id 'org.jetbrains.kotlin.plugin.allopen'
@@ -76,6 +85,7 @@ allOpen {
7685
annotation("org.openjdk.jmh.annotations.State")
7786
}
7887
```
88+
then you don't have to make benchmark classes and methods `open`.
7989

8090
# Runtime Library
8191

@@ -86,11 +96,23 @@ repositories {
8696
maven { url 'https://dl.bintray.com/kotlin/kotlinx' }
8797
}
8898
89-
dependencies {
90-
implementation "org.jetbrains.kotlinx:kotlinx.benchmark.runtime" version "0.2.0"
99+
kotlin {
100+
sourceSets {
101+
commonMain {
102+
dependencies {
103+
implementation("org.jetbrains.kotlinx:kotlinx.benchmark.runtime:0.2.0-dev-20")
104+
}
105+
}
106+
}
91107
}
92108
```
93109

110+
To use the library in a JVM-only project add the platform to the artifact name, e.g.:
111+
112+
```groovy
113+
implementation("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:0.2.0-dev-20")
114+
```
115+
94116
# Configuration
95117

96118
In a `build.gradle` file create ` benchmark` section, and inside it add a `targets` section.
@@ -216,3 +238,8 @@ benchmark {
216238
}
217239
}
218240
```
241+
242+
# Examples
243+
244+
The project contains [examples](https://github.com/Kotlin/kotlinx-benchmark/tree/master/examples) subproject that demonstrates using the library.
245+

0 commit comments

Comments
 (0)