forked from simdjson/simdjson-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
97 lines (81 loc) · 3.01 KB
/
build.gradle
File metadata and controls
97 lines (81 loc) · 3.01 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import me.champeau.jmh.JmhBytecodeGeneratorTask
import org.gradle.internal.os.OperatingSystem
plugins {
id 'java'
id 'scala'
id 'me.champeau.jmh' version '0.7.1'
}
group = 'org.simdjson'
version = '0.0.1-SNAPSHOT'
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(20)
}
}
ext {
junitVersion = '5.9.1'
}
dependencies {
jmhImplementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.15.2'
jmhImplementation group: 'com.alibaba.fastjson2', name: 'fastjson2', version: '2.0.35'
jmhImplementation group: 'com.jsoniter', name: 'jsoniter', version: '0.9.23'
jmhImplementation group: 'com.github.plokhotnyuk.jsoniter-scala', name: 'jsoniter-scala-core_2.13', version: '2.23.2'
compileOnly group: 'com.github.plokhotnyuk.jsoniter-scala', name: 'jsoniter-scala-macros_2.13', version: '2.23.2'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.24.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitVersion
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: junitVersion
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitVersion
}
test {
useJUnitPlatform()
jvmArgs += [
'--add-modules', 'jdk.incubator.vector',
'-Xmx2g'
]
}
tasks.withType(JmhBytecodeGeneratorTask).configureEach {
jvmArgs.set(["--add-modules=jdk.incubator.vector"])
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs.add("--add-modules=jdk.incubator.vector")
}
tasks.compileJmhScala.classpath = sourceSets.main.compileClasspath
tasks.compileJmhJava.classpath += files(sourceSets.jmh.scala.classesDirectory)
compileTestJava {
options.compilerArgs += [
'--add-modules', 'jdk.incubator.vector'
]
}
jmh {
fork = 1
warmupIterations = 3
iterations = 5
jvmArgsPrepend = [
'--add-modules=jdk.incubator.vector'
]
if (getBooleanProperty('jmh.profilersEnabled', false)) {
if (OperatingSystem.current().isLinux()) {
profilers = [
'perf',
'perfasm:intelSyntax=true',
'async:verbose=true;output=flamegraph;event=cpu;dir=./profilers/async;libPath=' + getAsyncProfilerLibPath('LD_LIBRARY_PATH')
]
} else if (OperatingSystem.current().isMacOsX()) {
profilers = [
'async:verbose=true;output=flamegraph;event=cpu;dir=./profilers/async;libPath=' + getAsyncProfilerLibPath('DYLD_LIBRARY_PATH')
]
}
}
if (project.hasProperty('jmh.includes')) {
includes = [project.findProperty('jmh.includes')]
}
}
def getBooleanProperty(String name, boolean defaultValue) {
Boolean.valueOf((project.findProperty(name) ?: defaultValue) as String)
}
static def getAsyncProfilerLibPath(String envVarName) {
System.getenv(envVarName) ?: System.getProperty('java.library.path')
}