Skip to content

OnPair: decode straight into the builder's byte storage - #9100

Merged
robert3005 merged 5 commits into
developfrom
rk/onpair-decode-into-builder
Aug 5, 2026
Merged

robert3005 merged 5 commits into
developfrom
rk/onpair-decode-into-builder

Conversation

@robert3005

@robert3005 robert3005 commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Decompress value straight into builders storage

@robert3005 robert3005 added the changelog/chore A trivial change label Jul 31, 2026
Comment thread encodings/onpair/src/canonical.rs Outdated
Comment thread encodings/onpair/src/array.rs
@robert3005
robert3005 marked this pull request as ready for review July 31, 2026 14:07
@robert3005
robert3005 force-pushed the rk/onpair-decode-into-builder branch 2 times, most recently from 83b3f8a to 8fa6c4f Compare August 1, 2026 10:30
@robert3005
robert3005 force-pushed the rk/onpair-decode-into-builder branch from 8fa6c4f to e097cd8 Compare August 4, 2026 12:46
@robert3005
robert3005 force-pushed the rk/onpair-decode-into-builder branch from e097cd8 to 3d06422 Compare August 4, 2026 23:14
@robert3005
robert3005 force-pushed the rk/onpair-decode-into-builder branch from 3d06422 to ee24c54 Compare August 4, 2026 23:15
@codspeed

codspeed Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 26.63%

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

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Simulation decode_varbin[(1000, 2)] 78.3 µs 61.8 µs +26.63%

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/onpair-decode-into-builder (4b715f9) with develop (c8dc903)

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/onpair-decode-into-builder branch from ee24c54 to 6d11fc1 Compare August 5, 2026 13:55
@robert3005
robert3005 force-pushed the rk/onpair-decode-into-builder branch from 6d11fc1 to ab7a561 Compare August 5, 2026 13:56
Comment thread encodings/onpair/src/canonical.rs Outdated
@robert3005
robert3005 force-pushed the rk/onpair-decode-into-builder branch from ab7a561 to ad18fe5 Compare August 5, 2026 15:02
@robert3005
robert3005 force-pushed the rk/onpair-decode-into-builder branch from ad18fe5 to 6e11a7e Compare August 5, 2026 16:12
Base automatically changed from rk/zstd-append-to-builder to develop August 5, 2026 16:45
@robert3005
robert3005 force-pushed the rk/onpair-decode-into-builder branch from f918cc2 to 3ea8db5 Compare August 5, 2026 16:45
Same shape as the FSST change: `append_to_builder` staged the decoded heap in a
temporary buffer before copying it in. `OnPairDecodePlan` hoists the code
window, the dictionary view, the per-row lengths and the total decoded size out
of `onpair_decode_bytes` so the decode can target the builder's spare capacity
via `append_decoded`, leaving one prefix sum over the lengths as the only work
beyond the bulk `try_decode_into`.

`decode_into` is `#[inline(always)]`: `try_decode_into` is generic over the
dictionary view and only specializes its batched copy loop once inlined into the
caller, so leaving the wrapper out of line costs ~2.5x.

Also extends the Arrow export benchmarks to cover OnPair alongside the other
string encodings, plus nullable variants and the two `append_to_builder`
benchmarks that reach an encoding's specialization directly — the Arrow export
cannot stand in for those, since `execute_until` canonicalizes a bare
FSST/OnPair/Zstd root before any builder sees 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>
@robert3005
robert3005 force-pushed the rk/onpair-decode-into-builder branch from 3ea8db5 to 4a58993 Compare August 5, 2026 16:58
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005
robert3005 merged commit 88653d3 into develop Aug 5, 2026
102 of 103 checks passed
@robert3005
robert3005 deleted the rk/onpair-decode-into-builder branch August 5, 2026 19:04
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