Skip to content

Commit 7205177

Browse files
authored
Update JMH (#3531)
* Update JMH * Restore workflow for benchmarks * Simplify JMH setup
1 parent 184d395 commit 7205177

File tree

3 files changed

+7
-23
lines changed

3 files changed

+7
-23
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ build
1212
out
1313
target
1414
local.properties
15+
benchmarks.jar
1516
/kotlin-js-store

benchmarks/build.gradle.kts

+5-19
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
@file:Suppress("UnstableApiUsage")
66

7-
import me.champeau.gradle.*
7+
import me.champeau.jmh.*
88
import org.jetbrains.kotlin.gradle.tasks.*
99

1010
plugins {
1111
id("com.github.johnrengelman.shadow")
12-
id("me.champeau.gradle.jmh") apply false
12+
id("me.champeau.jmh")
1313
}
1414

1515
repositories {
@@ -21,33 +21,19 @@ java {
2121
targetCompatibility = JavaVersion.VERSION_1_8
2222
}
2323

24-
apply(plugin="me.champeau.gradle.jmh")
25-
2624
tasks.named<KotlinCompile>("compileJmhKotlin") {
2725
kotlinOptions {
2826
jvmTarget = "1.8"
2927
freeCompilerArgs += "-Xjvm-default=enable"
3028
}
3129
}
3230

33-
// It is better to use the following to run benchmarks, otherwise you may get unexpected errors:
34-
// ./gradlew --no-daemon cleanJmhJar jmh -Pjmh="MyBenchmark"
35-
extensions.configure<JMHPluginExtension>("jmh") {
36-
jmhVersion = "1.26"
37-
duplicateClassesStrategy = DuplicatesStrategy.INCLUDE
38-
failOnError = true
39-
resultFormat = "CSV"
40-
project.findProperty("jmh")?.also {
41-
include = listOf(".*$it.*")
42-
}
43-
// includeTests = false
44-
}
45-
4631
val jmhJarTask = tasks.named<Jar>("jmhJar") {
4732
archiveBaseName by "benchmarks"
4833
archiveClassifier by null
4934
archiveVersion by null
50-
destinationDirectory.file("$rootDir")
35+
archiveVersion.convention(null as String?)
36+
destinationDirectory.set(file("$rootDir"))
5137
}
5238

5339
tasks {
@@ -63,7 +49,7 @@ tasks {
6349
}
6450

6551
dependencies {
66-
implementation("org.openjdk.jmh:jmh-core:1.26")
52+
implementation("org.openjdk.jmh:jmh-core:1.35")
6753
implementation("io.projectreactor:reactor-core:${version("reactor")}")
6854
implementation("io.reactivex.rxjava2:rxjava:2.1.9")
6955
implementation("com.github.akarnokd:rxjava2-extensions:0.20.8")

settings.gradle

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
pluginManagement {
66
plugins {
77
id "org.openjfx.javafxplugin" version javafx_plugin_version
8-
9-
// JMH
10-
id "net.ltgt.apt" version "0.21"
11-
id "me.champeau.gradle.jmh" version "0.5.3"
8+
id "me.champeau.jmh" version "0.6.8"
129
}
1310

1411
repositories {

0 commit comments

Comments
 (0)