forked from apptik/JustJson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
perf.gradle
59 lines (49 loc) · 1.7 KB
/
perf.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
50
51
52
53
54
55
56
57
58
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'com.github.johnrengelman.shadow'
idea {
module {
scopes.PROVIDED.plus += [project.configurations.perfCompile]
}
}
task prepbench(dependsOn: perfClasses) {
shadowJar {
classifier = "benchmarks"
from sourceSets.perf.output
from sourceSets.main.output
from project.configurations.perfRuntime
shadowJar.doFirst {
shadowJar.manifest.attributes.put("Main-Class", "org.openjdk.jmh.Main")
}
}
doLast {
shadowJar.execute()
}
}
task perf(type: JavaExec) {
main = 'org.openjdk.jmh.Main'
classpath = project.sourceSets.perf.runtimeClasspath
maxHeapSize = "512m"
jvmArgs '-XX:+UnlockCommercialFeatures'
jvmArgs '-XX:+FlightRecorder'
if (project.hasProperty('jmh')) {
args(project.jmh.split(' '))
} else {
//args '-h' // help output
args '-f' // fork
args '1'
args '-wi' // warmup iterations
args '7'
args '-i' // test iterations
args '5'
args '-r' // time per execution in seconds
args '5'
//args '-prof' // profilers
//args 'HS_GC' // HotSpot (tm) memory manager (GC) profiling via implementation-specific MBeans
//args 'HS_RT' // HotSpot (tm) runtime profiling via implementation-specific MBeans
//args 'HS_THR' // HotSpot (tm) threading subsystem via implementation-specific MBeans
//args 'HS_COMP' // HotSpot (tm) JIT compiler profiling via implementation-specific MBeans
//args 'HS_CL' // HotSpot (tm) classloader profiling via implementation-specific MBeans
//args 'STACK' // Simple and naive Java stack profiler
}
}