-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
58 lines (49 loc) · 1.75 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
58 lines (49 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import org.gradle.internal.os.OperatingSystem
plugins {
java
id("me.champeau.jmh") version "0.7.2"
}
group = "io.codspeed"
version = "1.0-SNAPSHOT"
jmh {
jmhVersion.set("0.1.1")
benchmarkMode.set(listOf("avgt"))
timeUnit.set("ns")
warmupIterations.set(2)
warmup.set("1s")
iterations.set(3)
timeOnIteration.set("1s")
fork.set(3)
resultFormat.set("JSON")
// Force a System.gc() between iterations so heap state is reset before each
// measurement starts. Without this, a GC pause can land inside the measurement
// window and show up as a spurious regression in CI.
forceGC = true
// Run subset of the benchmarks to avoid long CI runtimes
if (System.getenv("CODSPEED_ENV") != null) {
logger.lifecycle("CODSPEED_ENV detected — running curated CI benchmark subset")
// me.champeau.jmh joins `includes` with commas into a single positional
// regex passed to JMH, so multiple entries collapse to one pattern with
// literal commas and match nothing. Use a single alternation instead.
includes.set(listOf(
".*(SleepBenchmark|BacktrackingBenchmark|FibBenchmark|FibFlamegraphBenchmark).*",
))
}
// FibFlamegraphBenchmark exists only to exercise the macOS flamegraph
// pipeline on codspeed-macro runners. Skip it on Linux/Windows so the
// cross-platform jobs don't run a redundant fib variant.
if (!OperatingSystem.current().isMacOsX) {
excludes.add(".*FibFlamegraphBenchmark.*")
}
}
sourceSets {
named("jmh") {
java {
srcDir("../TheAlgorithms-Java/src/main/java")
}
}
}
dependencies {
jmh("org.apache.commons:commons-lang3:3.20.0")
jmh("org.apache.commons:commons-collections4:4.5.0")
}