benchmark: keep JMH results

This commit is contained in:
Daniel Langbein 2025-01-31 16:25:34 +01:00
parent f5c10d77c2
commit ac7d8608f2
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -3,6 +3,9 @@
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.7/userguide/building_java_projects.html in the Gradle documentation. * For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.7/userguide/building_java_projects.html in the Gradle documentation.
*/ */
import java.util.Date
import java.text.SimpleDateFormat
plugins { plugins {
// Apply the application plugin to add support for building a CLI application in Java. // Apply the application plugin to add support for building a CLI application in Java.
application application
@ -84,6 +87,10 @@ tasks {
} }
} }
fun buildTime(): String {
return SimpleDateFormat("yyyyMMddHHmm").format(Date())
}
// https://github.com/melix/jmh-gradle-plugin/blob/master/README.adoc#configuration-options // https://github.com/melix/jmh-gradle-plugin/blob/master/README.adoc#configuration-options
jmh { jmh {
// Use latest JMH version (1.37, https://github.com/openjdk/jmh/tags) // Use latest JMH version (1.37, https://github.com/openjdk/jmh/tags)
@ -97,14 +104,14 @@ jmh {
forceGC = true forceGC = true
// If human output is saved, it won't be written to stdout while running the benchmark! // If human output is saved, it won't be written to stdout while running the benchmark!
humanOutputFile = project.file("${project.layout.buildDirectory.get()}/reports/jmh/human.txt") humanOutputFile = project.file("${project.layout.buildDirectory.get()}/reports/jmh/${buildTime()}/human.txt")
resultsFile = project.file("${project.layout.buildDirectory.get()}/reports/jmh/results.csv") resultsFile = project.file("${project.layout.buildDirectory.get()}/reports/jmh/${buildTime()}/results.csv")
resultFormat = "CSV" resultFormat = "CSV"
excludes = listOf( excludes = listOf(
// To skip JmhCgl or JmhCompetition, uncomment it below. // To skip JmhCgl or JmhCompetition, uncomment it below.
// "de.uni_marburg.powersort.benchmark.JmhCgl.benchmark", //"de.uni_marburg.powersort.benchmark.JmhCgl.benchmark",
"de.uni_marburg.powersort.benchmark.JmhCompetition.benchmark", "de.uni_marburg.powersort.benchmark.JmhCompetition.benchmark",
) )
} }