Optimize delta binary decoder in the case where bitwidth=0#9477
Optimize delta binary decoder in the case where bitwidth=0#9477etseidl wants to merge 2 commits intoapache:mainfrom
Conversation
|
Not seeing the huge improvement from arrow-cpp, but still a nice speedup, and it doesn't seem to be impacting cases where the optimization can't be used. New benchmarks on my workstation (x86 i7-12700K) comparing main (no_opt) to this branch (opt) And the rest of the binary packed benches Details |
|
Currently unknown what impact this optimization will have on the other delta encodings. There could be a good speedup for situations like constant length strings + DELTA_LENGTH_BYTE_ARRAY (think UUIDs or hashes), as well as long runs of the same prefix or long runs of strings with no shared prefix with DELTA_BYTE_ARRAY. |
There was a problem hiding this comment.
Pull request overview
This PR optimizes DELTA_BINARY_PACKED decoding for the common case where a miniblock has bit_width == 0, aiming to match speedups observed in Arrow C++ and address issue #9476.
Changes:
- Add a fast-path in the delta binary packed decoder for
bit_width == 0miniblocks (including constant-value and arithmetic-progression cases). - Add larger regression tests covering constant, increasing, and mixed patterns for
Int32/Int64. - Add new benchmark cases targeting constant and monotonically increasing delta-encoded pages.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
parquet/src/encodings/decoding.rs |
Adds bit_width == 0 decoding fast-path and new large tests for delta decoding correctness. |
parquet/benches/arrow_reader.rs |
Adds a page generator and benchmark cases for delta binary packed constant/increasing patterns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Which issue does this PR close?
Rationale for this change
Explore if we can achieve the speedups seen in arrow-cpp (apache/arrow#49296).
What changes are included in this PR?
Adds special cases to the delta binary packed decoder when bitwidth for a miniblock is 0. The optimization avoids relying on previous values to decode current ones.
Are these changes tested?
Yes, tests have been added, as well as new benchmarks.
Are there any user-facing changes?
No