Skip to content

feat(vortex-geo): ST_Distance via the geo crate + Polygon type#8497

Open
HarukiMoriarty wants to merge 2 commits into
developfrom
vortex-geo-pr
Open

feat(vortex-geo): ST_Distance via the geo crate + Polygon type#8497
HarukiMoriarty wants to merge 2 commits into
developfrom
vortex-geo-pr

Conversation

@HarukiMoriarty

Copy link
Copy Markdown
Contributor

Summary

  1. offload the math to geo: unification, one distance (and remaining geo functions) implementation, replace the hand-roll kernel.
  2. support polygon: as a second native type riding that same path
  3. all geometry decode goes through Arrow/geoarrow

The performance decreased (5.6ms -> 12ms on Q1) compared with the old direct-coordinate kernel, it is a tradeoff for one unified, general decode path. The cost is the intermediate allocation/enumeration, not the math itself. Type-specialized fast paths (e.g. point-point straight off the coordinate struct) can recover it later without changing the API.

Testing

4 distance behavior tests through geo crate, and tests for polygon type.

@HarukiMoriarty HarukiMoriarty requested a review from a team June 18, 2026 19:03
Signed-off-by: Nemo Yu <zyu379@wisc.edu>
@codspeed-hq

codspeed-hq Bot commented Jun 18, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 22.57%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 93 improved benchmarks
❌ 12 regressed benchmarks
✅ 1476 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation take_10k_random 197.7 µs 253.7 µs -22.08%
Simulation take_10k_contiguous 217.6 µs 274.4 µs -20.68%
Simulation patched_take_10k_contiguous_patches 232.1 µs 288.8 µs -19.64%
Simulation patched_take_10k_random 244.5 µs 301.2 µs -18.83%
Simulation encode_varbin[(1000, 2)] 239.6 µs 294.6 µs -18.67%
Simulation chunked_varbinview_canonical_into[(1000, 10)] 162.7 µs 191.4 µs -14.98%
Simulation varbinview_large 112.6 µs 130.8 µs -13.93%
Simulation decompress_rd[f64, (100000, 0.01)] 890.1 µs 1,020.4 µs -12.77%
Simulation decompress_rd[f64, (100000, 0.1)] 890.2 µs 1,020.4 µs -12.76%
Simulation and_true_constant 14.9 µs 16.8 µs -11.41%
Simulation or_false_constant 14.9 µs 16.8 µs -11.23%
Simulation bench_many_codes_few_values[1024] 467.5 µs 526.3 µs -11.17%
Simulation search_index_mixed_out_of_range 255.9 µs 78.9 µs ×3.2
Simulation search_index_above_max 255.7 µs 78.9 µs ×3.2
Simulation search_index_below_min 255.7 µs 78.9 µs ×3.2
Simulation search_index_full_range_random 255.9 µs 79 µs ×3.2
Simulation search_index_in_range 256.1 µs 79.2 µs ×3.2
Simulation chunked_dict_primitive_into_canonical[u32, (1000, 10, 10)] 185.4 µs 87.3 µs ×2.1
Simulation chunked_bool_canonical_into[(10, 1000)] 751.4 µs 492.6 µs +52.55%
Simulation chunked_opt_bool_canonical_into[(10, 1000)] 866.6 µs 572.3 µs +51.42%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing vortex-geo-pr (242ee4c) with develop (aef6307)1

Open in CodSpeed

Footnotes

  1. No successful run was found on develop (ed69077) during the generation of this report, so aef6307 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant