From ac7d8608f28c4bb110b78a3ac6d86e4c40046f4f Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Fri, 31 Jan 2025 16:25:34 +0100 Subject: [PATCH] benchmark: keep JMH results --- app/build.gradle.kts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 522971a..69ae151 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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. */ +import java.util.Date +import java.text.SimpleDateFormat + plugins { // Apply the application plugin to add support for building a CLI application in Java. 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 jmh { // Use latest JMH version (1.37, https://github.com/openjdk/jmh/tags) @@ -97,14 +104,14 @@ jmh { forceGC = true // 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" excludes = listOf( // 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", ) }