Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The public API of this library consists of the public functions declared in
file [H3Core.java](./src/main/java/com/uber/h3core/H3Core.java), and support
for the Linux x64 and Darwin x64 platforms.

## Unreleased Changes
### Changed
- Restored benchmark target to the build script. (#188)

## [4.3.2] - 2025-10-10
### Changed
- Added option to build and publish as an Android module into h3-android. (#184)
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,10 @@ Then open the file `build/docs/javadoc/index.html`.

## Benchmarking

To run benchmarks, either execute them from IntelliJ or run the following from shell: (Replace the class name as needed)

> [!TIP]
> These instructions need to be updated for Gradle.
To run benchmarks, either execute them from IntelliJ or run the following from shell:

```sh
mvn exec:exec -Dexec.executable="java" -Dexec.args="-classpath %classpath com.uber.h3core.benchmarking.H3CoreBenchmark" -Dexec.classpathScope="test"
./gradlew benchmark -Ph3UseDocker=false
```

## Contributing
Expand Down
24 changes: 22 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ repositories {
}

dependencies {
testImplementation 'org.openjdk.jmh:jmh-core:1.19'
testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.19'
testImplementation 'org.openjdk.jmh:jmh-core:1.37'
testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.37'
testImplementation 'com.google.guava:guava:33.3.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.2'
Expand Down Expand Up @@ -101,6 +101,26 @@ processResources {
dependsOn buildH3
}

def benchmarkClasses = [
'benchmarkH3Core': 'H3CoreBenchmark',
'benchmarkGridDisk': 'GridDiskBenchmark',
'benchmarkH3ParentChild': 'H3ParentChildBenchmark',
'benchmarkCellsToMultipolygon': 'CellsToMultiPolygonBenchmark',
'benchmarkPolygonToCells': 'PolygonToCellsBenchmark'
]

benchmarkClasses.each { taskName, className ->
tasks.register(taskName, JavaExec) {
dependsOn processResources
mainClass = "com.uber.h3core.benchmarking.${className}"
classpath = sourceSets.test.runtimeClasspath
}
}

task benchmark {
dependsOn benchmarkClasses.keySet()
}

test {
dependsOn processResources
// finalizedBy jacocoTestReport
Expand Down
Loading