mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
The existing tests/performance/h3.xml only exercises geoToH3 at resolution 15. PR #100272 (https://github.com/ClickHouse/ClickHouse/pull/100272) reports speed-ups for several other H3 functions when switching to the h3o (Rust) backend. Add a new perf test that covers the rest of the functions mentioned there (`geoToH3` at resolution 9, `h3ToGeo`, `h3ToGeoBoundary`, `h3ToParent`, `h3CellAreaM2`, `h3IsValid`, `h3kRing`, `h3Distance`, `h3PointDistM`) so the speed-ups can be measured and future regressions can be detected by the perf comparison job. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
30 lines
1.9 KiB
XML
30 lines
1.9 KiB
XML
<test>
|
|
<!-- Performance tests for the H3 functions whose performance is improved by switching the
|
|
backend to h3o (Rust) - see https://github.com/ClickHouse/ClickHouse/pull/100272.
|
|
The existing h3.xml only exercises geoToH3 at resolution 15. -->
|
|
|
|
<create_query>CREATE TABLE h3_indexes_perf (h3 UInt64) ENGINE = Memory</create_query>
|
|
<fill_query>INSERT INTO h3_indexes_perf SELECT geoToH3(55.75 + rand(1) / 0x100000000, 37.62 + rand(2) / 0x100000000, toUInt8(9)) FROM zeros(100000)</fill_query>
|
|
|
|
<!-- Forward direction: coordinates -> H3 index -->
|
|
<query>SELECT count() FROM zeros(100000) WHERE NOT ignore(geoToH3(55.75 + rand(1) / 0x100000000, 37.62 + rand(2) / 0x100000000, toUInt8(9)))</query>
|
|
|
|
<!-- Reverse direction: H3 index -> coordinates -->
|
|
<query>SELECT count() FROM h3_indexes_perf WHERE NOT ignore(h3ToGeo(h3))</query>
|
|
<query>SELECT count() FROM h3_indexes_perf WHERE NOT ignore(h3ToGeoBoundary(h3))</query>
|
|
|
|
<!-- Hierarchy and metrics -->
|
|
<query>SELECT count() FROM h3_indexes_perf WHERE NOT ignore(h3ToParent(h3, materialize(toUInt8(3))))</query>
|
|
<query>SELECT count() FROM h3_indexes_perf WHERE NOT ignore(h3CellAreaM2(h3))</query>
|
|
|
|
<!-- Validation, neighbours, and grid distance -->
|
|
<query>SELECT count() FROM h3_indexes_perf WHERE NOT ignore(h3IsValid(h3))</query>
|
|
<query>SELECT count() FROM h3_indexes_perf WHERE NOT ignore(h3kRing(h3, materialize(toUInt16(1))))</query>
|
|
<query>SELECT count() FROM h3_indexes_perf WHERE NOT ignore(h3Distance(h3, materialize(geoToH3(55.75, 37.62, toUInt8(9)))))</query>
|
|
|
|
<!-- Great-circle distance helper -->
|
|
<query>SELECT count() FROM zeros(100000) WHERE NOT ignore(h3PointDistM(55.75 + rand(1) / 0x100000000, 37.62 + rand(2) / 0x100000000, 55.76 + rand(3) / 0x100000000, 37.63 + rand(4) / 0x100000000))</query>
|
|
|
|
<drop_query>DROP TABLE IF EXISTS h3_indexes_perf</drop_query>
|
|
</test>
|