-
Notifications
You must be signed in to change notification settings - Fork 0
/
component-benchmark.gradle
49 lines (43 loc) · 2.57 KB
/
component-benchmark.gradle
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
apply plugin: "me.champeau.gradle.jmh"
ext {
BENCHMARK_RESULTS_DIR = project.file("${project.buildDir}/reports/jmh")
BENCHMARK_OUTPUT_DIRS = [
project.file("${project.buildDir}/jmh-generated-classes"),
project.file("${project.buildDir}/jmh-generated-resources"),
project.file("${project.buildDir}/jmh-generated-sources")
]
}
jmh {
iterations = 10 // Number of measurement iterations to do.
batchSize = 1 // Batch size: number of benchmark method calls per operation. (some benchmark modes can ignore this setting)
fork = 2 // How many times to forks a single benchmark. Use 0 to disable forking altogether
failOnError = false // Should JMH fail immediately if any benchmark had experienced the unrecoverable error?
forceGC = false // Should JMH force GC between iterations?
humanOutputFile = new File(BENCHMARK_RESULTS_DIR, "human.txt") // human-readable output file
resultsFile = new File(BENCHMARK_RESULTS_DIR, "results.txt") // results file
benchmarkParameters = [:] // Benchmark parameters.
profilers = ['gc', 'stack'] // Use profilers to collect additional data. Supported profilers: [cl, comp, gc, stack, perf, perfnorm, perfasm, xperf, xperfasm, hs_cl, hs_comp, hs_gc, hs_rt, hs_thr]
resultFormat = 'JSON' // Result format type (one of CSV, JSON, NONE, SCSV, TEXT)
synchronizeIterations = false // Synchronize iterations?
threads = 4 // Number of worker threads to run with.
timeUnit = 'ms' // Output time unit. Available time units are: [m, s, ms, us, ns].
verbosity = 'NORMAL' // Verbosity mode. Available modes are: [SILENT, NORMAL, EXTRA]
warmup = '10s' // Time to spend at each warmup iteration.
warmupBatchSize = 10 // Warmup batch size: number of benchmark method calls per operation.
warmupForks = 0 // How many warmup forks to make for a single benchmark. 0 to disable warmup forks.
warmupIterations = 1 // Number of warmup iterations to do.
warmupMode = 'INDI' // Warmup mode for warming up selected benchmarks. Warmup modes are: [INDI, BULK, BULK_INDI].
warmupBenchmarks = ['.*Warmup'] // Warmup benchmarks to include in the run in addition to already selected. JMH will not measure these benchmarks, but only use them for the warmup.
jmhVersion = '1.22' // Specifies JMH version
includeTests = false
duplicateClassesStrategy = 'fail'
}
task clearBenchmarkResults(type: Delete) {
BENCHMARK_OUTPUT_DIRS.each {
delete it
}
}
task benchmark {
dependsOn project.tasks.clearBenchmarkResults,
project.tasks.assemble, project.tasks.jmh
}