Skip to content

feat(vortex-bench): infra of SpatialBench on DuckDB, plain binary#8598

Merged
HarukiMoriarty merged 7 commits into
developfrom
nemo/spatial-wkb
Jun 30, 2026
Merged

feat(vortex-bench): infra of SpatialBench on DuckDB, plain binary#8598
HarukiMoriarty merged 7 commits into
developfrom
nemo/spatial-wkb

Conversation

@HarukiMoriarty

@HarukiMoriarty HarukiMoriarty commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a SpatialBench benchmark that runs on DuckDB across two storage lanes, Vortex binary BLOB and Parquet binary BLOB.

Benchmark results

Local, warm, median of 5 (ms).

Q Query Parquet Vortex Winner
Q1 trips within 50km of Sedona 170.2 ms 132.7 ms Vortex 1.3×
Q2 trips in Coconino County 379.5 ms 249.2 ms Vortex 1.5×
Q3 monthly stats within 15km 235.5 ms 203.3 ms Vortex 1.2×
Q4 top-1000-tip zone distribution 404.8 ms 114.8 ms Vortex 3.5×
Q5 repeat-customer convex hulls 3174.8 ms 3187.3 ms tie
Q6 zone stats in bbox 718.8 ms 306.1 ms Vortex 2.3×
Q7 route-detour ratios 938.6 ms 1046.1 ms tie (~noise)
Q8 nearby pickups per building (500m) 1000.6 ms 1071.2 ms tie (~noise)
Q9 building conflation (IoU) 36.4 ms 40.6 ms tie
Q10 zone stats (LEFT JOIN) timeout timeout
Q11 cross-zone trips timeout timeout
Q12 5 nearest buildings (KNN) timeout timeout

Takeaways

Vortex wins the scan/filter-bound queries (Q1–Q4, Q6) by up to 3.5×. Q5/Q7/Q8/Q9 are compute-bound (DuckDB spatial join dominates), so the formats converge. Q10–Q12 time out on both, because the unindexed spatial join is the wall, independent of storage format.

@HarukiMoriarty HarukiMoriarty requested a review from a team June 25, 2026 20:14
@HarukiMoriarty HarukiMoriarty added the changelog/feature A new feature label Jun 25, 2026
@HarukiMoriarty HarukiMoriarty changed the title feat(vortex-bench): infra of SpatialBench on DuckDB, wkb only feat(vortex-bench): infra of SpatialBench on DuckDB, plain binary Jun 25, 2026

@myrrc myrrc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Can you please add support of this benchmark to vx-bench binary as well?

@AdamGS Can you have a look regarding your work of moving data generation to vx-bench?

Comment thread benchmarks/duckdb-bench/src/lib.rs
@myrrc myrrc requested a review from AdamGS June 26, 2026 09:29
Signed-off-by: Nemo Yu <zyu379@wisc.edu>
@codspeed-hq

codspeed-hq Bot commented Jun 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 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.

⚡ 4 improved benchmarks
❌ 1 regressed benchmark
✅ 1590 untouched benchmarks
⏩ 4 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_varbinview_into_canonical[(1000, 10)] 168.9 µs 205.7 µs -17.87%
Simulation chunked_varbinview_canonical_into[(100, 100)] 259.5 µs 224.4 µs +15.64%
Simulation chunked_varbinview_into_canonical[(100, 100)] 306.6 µs 271.5 µs +12.95%
Simulation bitwise_not_vortex_buffer_mut[128] 273.6 ns 244.4 ns +11.93%
Simulation rebuild_naive 111.1 µs 99.9 µs +11.19%

Tip

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


Comparing nemo/spatial-wkb (a9fb661) with develop (797b650)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Comment thread vortex-bench/src/benchmark.rs Outdated
Signed-off-by: Nemo Yu <zyu379@wisc.edu>
@HarukiMoriarty

Copy link
Copy Markdown
Contributor Author

Fixed, wire to vx_bench in next PR.

@HarukiMoriarty HarukiMoriarty requested a review from a10y June 26, 2026 14:39
HarukiMoriarty and others added 2 commits June 26, 2026 13:38
Signed-off-by: Nemo Yu <zyu379@wisc.edu>
@HarukiMoriarty

Copy link
Copy Markdown
Contributor Author

@myrrc wire in vx_bench in #8607.

@myrrc myrrc self-requested a review June 29, 2026 13:27
HarukiMoriarty and others added 3 commits June 30, 2026 13:31
Signed-off-by: Nemo Yu <zyu379@wisc.edu>
Tag SpatialBench geometry columns with GeoParquet `geo` file metadata so
DuckDB's read_parquet surfaces them as GEOMETRY, and re-type the matching WKB
columns as the vortex.geo.wkb (WellKnownBinary) extension on the vortex lane so
the vortex scan surfaces them as GEOMETRY too. Queries then reference geometry
columns directly, dropping the ST_GeomFromWKB wrappers.

Signed-off-by: Nemo Yu <zyu379@wisc.edu>

@danking danking left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM since the follow up PR will address the review request.

@HarukiMoriarty HarukiMoriarty merged commit 3e7098c into develop Jun 30, 2026
73 checks passed
@HarukiMoriarty HarukiMoriarty deleted the nemo/spatial-wkb branch June 30, 2026 20:57
HarukiMoriarty added a commit that referenced this pull request Jul 2, 2026
)

## Summary

<!--
Why are you proposing this change, and what is its impact? 
Is it part of a long term effort, or a bigger change?

If this PR is related to a tracked effort or an open issue, please link
to the relevant issue.
-->

Wires SpatialBench into the `vx-bench` / `bench-orchestrator` pipeline
so it can be run end-to-end like the other benchmarks (datagen → Parquet
→ Vortex conversion → query). It builds on the WKB datagen landed in
#8598.

Running command:
```
uv run --project bench-orchestrator vx-bench run spatialbench --engine duckdb --format parquet,vortex --opt scale-factor=N --queries 1,2,3,4,5,6,7,8,9 --iterations 3
```

## Limitation
<!--
No need to duplicate information from the previous section, but if
you're touching many
parts of the code base, its worth explicitly noting the important
changes or how they are tested.
-->

- DuckDB-only. For now SpatialBench queries use DuckDB-specific ST_*
spatial SQL that DataFusion has no functions for yet. There is a a
single ad-hoc entry in `BENCHMARK_ENGINES = { SPATIALBENCH: {DUCKDB} }`.

- No dictionary encoding / compaction on the WKB column. WKB geometry
blobs are large and effectively unique, so running the dictionary
builder over them balloons memory (tens of GB) for zero compression
gain. The normal compaction path is preserved for every other column on
every other benchmark.

- Queries 10, 11, 12 is timeout simply because DuckDB poorly support on
Spatial index.

## Performance

SF=1.0
```
┏━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Query ┃ duckdb:parquet (base) ┃   duckdb:vortex ┃
┡━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
│ 1     │                39.1ms │  14.6ms (0.37x) │
│ 2     │                72.1ms │  24.9ms (0.35x) │
│ 3     │                57.7ms │  20.1ms (0.35x) │
│ 4     │               113.1ms │  70.6ms (0.62x) │
│ 5     │               354.2ms │ 288.4ms (0.81x) │
│ 6     │               169.5ms │  91.6ms (0.54x) │
│ 7     │               156.7ms │  71.5ms (0.46x) │
│ 8     │               196.5ms │  80.3ms (0.41x) │
│ 9     │                20.3ms │  18.7ms (0.92x) │
└───────┴───────────────────────┴─────────────────┘
```

SF=3
```
┏━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Query ┃ duckdb:parquet (base) ┃   duckdb:vortex ┃
┡━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
│ 1     │                50.7ms │  31.5ms (0.62x) │
│ 2     │               126.2ms │  60.3ms (0.48x) │
│ 3     │                71.9ms │  42.9ms (0.60x) │
│ 4     │               539.9ms │  64.9ms (0.12x) │
│ 5     │               948.7ms │ 874.5ms (0.92x) │
│ 6     │               656.2ms │ 121.7ms (0.19x) │
│ 7     │               256.6ms │ 232.1ms (0.90x) │
│ 8     │               273.8ms │ 244.6ms (0.89x) │
│ 9     │                35.7ms │  27.9ms (0.78x) │
└───────┴───────────────────────┴─────────────────┘
```

SF=10
```
┏━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Query ┃ duckdb:parquet (base) ┃   duckdb:vortex ┃
┡━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
│ 1     │               158.6ms │ 114.4ms (0.72x) │
│ 2     │               255.1ms │ 219.3ms (0.86x) │
│ 3     │               229.2ms │ 181.5ms (0.79x) │
│ 4     │               184.5ms │ 134.3ms (0.73x) │
│ 5     │                 3.30s │   3.08s (0.93x) │
│ 6     │               476.4ms │ 348.9ms (0.73x) │
│ 7     │               918.2ms │ 961.2ms (1.05x) │
│ 8     │               980.6ms │ 926.7ms (0.94x) │
│ 9     │                33.7ms │  33.6ms (1.00x) │
└───────┴───────────────────────┴─────────────────┘
```

<!--
Are there any user-facing changes that might require documentation
updates
Is any public API changed?
-->

---------

Signed-off-by: Nemo Yu <zyu379@wisc.edu>
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.

4 participants