@@ -37,8 +37,8 @@ repositories {
3737}
3838
3939dependencies {
40- testImplementation ' org.openjdk.jmh:jmh-core:1.19 '
41- testAnnotationProcessor ' org.openjdk.jmh:jmh-generator-annprocess:1.19 '
40+ testImplementation ' org.openjdk.jmh:jmh-core:1.37 '
41+ testAnnotationProcessor ' org.openjdk.jmh:jmh-generator-annprocess:1.37 '
4242 testImplementation ' com.google.guava:guava:33.3.1-jre'
4343 testImplementation ' org.junit.jupiter:junit-jupiter:5.11.2'
4444 testRuntimeOnly ' org.junit.platform:junit-platform-launcher:1.11.2'
@@ -101,6 +101,26 @@ processResources {
101101 dependsOn buildH3
102102}
103103
104+ def benchmarkClasses = [
105+ ' benchmarkH3Core' : ' H3CoreBenchmark' ,
106+ ' benchmarkGridDisk' : ' GridDiskBenchmark' ,
107+ ' benchmarkH3ParentChild' : ' H3ParentChildBenchmark' ,
108+ ' benchmarkCellsToMultipolygon' : ' CellsToMultiPolygonBenchmark' ,
109+ ' benchmarkPolygonToCells' : ' PolygonToCellsBenchmark'
110+ ]
111+
112+ benchmarkClasses. each { taskName, className ->
113+ tasks. register(taskName, JavaExec ) {
114+ dependsOn processResources
115+ mainClass = " com.uber.h3core.benchmarking.${ className} "
116+ classpath = sourceSets. test. runtimeClasspath
117+ }
118+ }
119+
120+ task benchmark {
121+ dependsOn benchmarkClasses. keySet()
122+ }
123+
104124test {
105125 dependsOn processResources
106126 // finalizedBy jacocoTestReport
0 commit comments