summaryrefslogtreecommitdiff
path: root/simulator/buildSrc/src/main
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-19 13:24:36 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-22 16:47:56 +0100
commitf1aa2632804916fb364f4fa207ac8ab97479f711 (patch)
tree8663e3c4c860431d8d96124caa3f5415d6dc1304 /simulator/buildSrc/src/main
parent9dab4d7b3921cd48199d773c7dc4bae0f2273223 (diff)
simulator: Add benchmarks for resource consumption framework
This change adds an initial set of benchmarks for the resource consumption framework in order to measure the effect of changes on the performance of the simulator.
Diffstat (limited to 'simulator/buildSrc/src/main')
-rw-r--r--simulator/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts60
1 files changed, 60 insertions, 0 deletions
diff --git a/simulator/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts b/simulator/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts
new file mode 100644
index 00000000..d3bb886d
--- /dev/null
+++ b/simulator/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2021 AtLarge Research
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+import kotlinx.benchmark.gradle.*
+import org.jetbrains.kotlin.allopen.gradle.*
+
+plugins {
+ id("org.jetbrains.kotlinx.benchmark")
+ `java-library`
+ kotlin("plugin.allopen")
+}
+
+sourceSets {
+ register("jmh") {
+ compileClasspath += sourceSets["main"].output
+ runtimeClasspath += sourceSets["main"].output
+ }
+}
+
+configurations {
+ named("jmhImplementation") {
+ extendsFrom(configurations["implementation"])
+ }
+}
+
+configure<AllOpenExtension> {
+ annotation("org.openjdk.jmh.annotations.State")
+}
+
+benchmark {
+ targets {
+ register("jmh") {
+ this as JvmBenchmarkTarget
+ jmhVersion = "1.21"
+ }
+ }
+}
+
+dependencies {
+ implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime-jvm:0.3.0")
+}