Skip to content

Dict: gather dictionary values straight into a VarBinBuilder - #9098

Merged
robert3005 merged 6 commits into
developfrom
rk/dict-gather-into-builder
Aug 5, 2026
Merged

robert3005 merged 6 commits into
developfrom
rk/dict-gather-into-builder

Conversation

@robert3005

@robert3005 robert3005 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Materialize dictionary values straight into VarBinBuilder instead of copying

Comment thread vortex-array/src/arrays/dict/vtable/mod.rs Outdated
@robert3005 robert3005 added the changelog/chore A trivial change label Jul 31, 2026
@robert3005
robert3005 marked this pull request as ready for review July 31, 2026 13:42
@robert3005
robert3005 force-pushed the rk/dict-gather-into-builder branch from 91142df to c82aa58 Compare July 31, 2026 18:11
@codspeed

codspeed Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 47.2%

⚡ 1 improved benchmark
✅ 1829 untouched benchmarks
⏩ 43 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Simulation decompress[u64, (10000, 1024)] 175 µs 118.9 µs +47.2%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing rk/dict-gather-into-builder (759cab5) with develop (3884b98)

Open in CodSpeed

Footnotes

  1. 43 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. ↩

@robert3005
robert3005 force-pushed the rk/dict-gather-into-builder branch from c82aa58 to e3cd801 Compare August 4, 2026 12:46
Comment thread vortex-array/src/arrays/dict/vtable/mod.rs Outdated
Comment thread vortex-array/src/arrays/dict/vtable/mod.rs Outdated
@robert3005
robert3005 force-pushed the rk/dict-gather-into-builder branch from ef964a6 to bc69d12 Compare August 4, 2026 23:14
Comment thread vortex-array/src/arrays/dict/vtable/mod.rs Outdated
Base automatically changed from rk/fsst-decode-into-builder to develop August 5, 2026 13:55
@robert3005
robert3005 force-pushed the rk/dict-gather-into-builder branch from e92503b to defd107 Compare August 5, 2026 13:55
Appending a string dictionary to a builder went through `take_canonical`,
which first materializes the values at full logical length — allocating and
re-reading a views buffer proportional to the row count. The dictionary is
usually far smaller than the column, so resolving each code against it in place
skips that intermediate and leaves one `memcpy` per row.

The fast path indexes the codes and the dictionary's views and data buffers as
host slices, so `varbin_fast_path_is_host` gates it on residency; a
device-resident dictionary still takes the canonical route, where a device
kernel can serve it.

Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005
robert3005 force-pushed the rk/dict-gather-into-builder branch from defd107 to 1a2a044 Compare August 5, 2026 13:56
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005
robert3005 merged commit 3d0c124 into develop Aug 5, 2026
73 checks passed
@robert3005
robert3005 deleted the rk/dict-gather-into-builder branch August 5, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants