uber / h3

Hexagonal hierarchical geospatial indexing system
https://h3geo.org
Apache License 2.0
4.83k stars 459 forks source link

Generate polygonToCells benchmark with Natural Earth country geometry #795

Closed nrabinowitz closed 10 months ago

nrabinowitz commented 10 months ago

Adds a script and CMake targets to download relatively simple geometry for all countries and create a benchmark file. The benchmark currently runs both old and new algos for comparison; my local output:

Res 0   -- polygonToCells_AllCountries: 195351.800000 microseconds per iteration (5 iterations)
    -- polygonToCells_AllCountries: 35108.600000 microseconds per iteration (5 iterations)
Res 1   -- polygonToCells_AllCountries: 329267.000000 microseconds per iteration (5 iterations)
    -- polygonToCells_AllCountries: 18723.800000 microseconds per iteration (5 iterations)
Res 2   -- polygonToCells_AllCountries: 258062.200000 microseconds per iteration (5 iterations)
    -- polygonToCells_AllCountries: 65198.200000 microseconds per iteration (5 iterations)
Res 3   -- polygonToCells_AllCountries: 431086.600000 microseconds per iteration (5 iterations)
    -- polygonToCells_AllCountries: 280404.000000 microseconds per iteration (5 iterations)
Res 4   -- polygonToCells_AllCountries: 2043707.600000 microseconds per iteration (5 iterations)
    -- polygonToCells_AllCountries: 1464811.400000 microseconds per iteration (5 iterations)
Res 5   -- polygonToCells_AllCountries: 70389617.800000 microseconds per iteration (5 iterations)
    -- polygonToCells_AllCountries: 8704045.800000 microseconds per iteration (5 iterations)

At present, the CMake setup is a little awkward, as I wasn't sure how to add targets before you generate the source. To run the benchmark, you need:

cmake ..
make generate-country-benchmark
cmake ..
make bench_benchmarkCountries

I might be able to consolidate those steps, but I also want to be able to hand-edit the output and easily make/run again to try different benchmarks. Would love advice from someone more adept at CMake.

coveralls commented 10 months ago

Coverage Status

coverage: 98.784%. remained the same when pulling da287573d0edc7dad1e150e3972bf969ceeee53c on nrabinowitz:updated-polyfill-countries into 5d7c1c165fe5d2bce238758f7c1a8bb8646b06bd on uber:master.

isaacbrodsky commented 10 months ago

https://github.com/uber/h3/actions/runs/6713819602/job/18246045886?pr=795 This looks like an unrelated fuzzer timeout