This repository was archived by the owner on Aug 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbenchmark.gradle
44 lines (36 loc) · 1.5 KB
/
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
// Copyright (c) 2014 Project Iris. All rights reserved.
//
// The current language binding is an official support library of the Iris
// cloud messaging framework, and as such, the same licensing terms apply.
// For details please see http://iris.karalabe.com/downloads#License
// Load the JMH micro-benchmark plugin
plugins {
id "me.champeau.gradle.jmh" version "0.1.2"
}
apply from: 'build.gradle'
// Hack since the JMH plugin cannot handle renamed jars
archivesBaseName = rootProject.name
version = ''
// Configure the micro-benchmarks
jmh {
fork = 1 // Run benchmarks in a single, new Java process
benchmarkMode = 'avgt' // Print the average runtime of a call
timeUnit = 'ns' // Results should use nanosecond granularity
resultFormat = 'TEXT' // Report the results in plan human readable form
warmupIterations = 10 // Number of warm-up iterations to execute
warmup = "1s" // Runtime of one warm-up session
iterations = 10 // Number of benchmark iterations to execute
timeOnIteration = '1s' // Runtime of one benchmark session
}
// Pull in the latest JMH dependencies
dependencies {
jmh 'org.openjdk.jmh:jmh-core:1.1'
jmh 'org.openjdk.jmh:jmh-generator-annprocess:1.1'
jmh 'ch.qos.logback:logback-classic:0.9.26'
}
// Create a small task to report the obtained results to stdout
task report << {
print jmh.resultsFile.text
}
// Don't require remembering the tasks, just run the benchmarks
defaultTasks 'clean', 'jmh', 'report'