perf(nimble): Add bulk-scan path to legacy fixed-width reads (#18612) - #18612
Open
MatzeB wants to merge 2 commits into
Open
perf(nimble): Add bulk-scan path to legacy fixed-width reads (#18612)#18612MatzeB wants to merge 2 commits into
MatzeB wants to merge 2 commits into
Conversation
✅ Deploy Preview for meta-velox canceled.
|
Contributor
|
@MatzeB has exported this pull request. If you are a Meta employee, you can view the originating Diff in D116602815. |
Summary: Bugfix: Dense nullable reads using an `AlwaysTrue` visitor could return an all-valid vector even when the input contained nulls. The bulk path now copies the read-range null bitmap when the reader cannot return that buffer directly, then marks the result as nullable. Differential Revision: D116851691
…kincubator#18612) Summary: This diff is created by PerfAICT to optimize `facebook::nimble::legacy::callReadWithVisitor` in "fbcode/velox/dwio/nimble/encodings/legacy/EncodingUtils.h", by reducing CPU cycles spent in this function. ### Optimization Details The inclusive cost of `legacy::callReadWithVisitor` was dominated by `FixedBitWidthEncoding<T>::readWithVisitor`, which always decoded values one at a time via the scalar per-value slow path (`fixedBitArray_.get(row_++) + baseline_` followed by per-value `ColumnVisitor::process`). This change adds a bulk-scan fast path — mirroring the already-landed canonical implementation in the non-legacy `encodings/FixedBitWidthEncoding.h` — that handles the dominant dense, no-null, no-filter/hook, 4/8-byte integral ExtractToReader case with a single `bulkGetWithBaseline` decode plus `processFixedWidthRun`, falling back to the unchanged slow path for all other cases. All supporting helpers (`readWithVisitorFast`, `useFastPath`, `processFixedWidthRun`, `FixedBitArray`) are shared, not duplicated, so behavior is preserved. Differential Revision: D116602815
MatzeB
force-pushed
the
export-D116602815
branch
from
August 20, 2026 22:49
8721396 to
bc07b0b
Compare
Contributor
Author
|
I don't understand why "[Meta Internal-Only Changes Check]" CI complains... Maybe we need to land D116851691 aka #18611 first because we cannot express parent/child stack here on github... |
Selective Build Plan
Fast path • Graph from main@c3413b270eb5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
This diff is created by PerfAICT to optimize
facebook::nimble::legacy::callReadWithVisitorin "fbcode/velox/dwio/nimble/encodings/legacy/EncodingUtils.h", by reducing CPU cycles spent in this function.Optimization Details
The inclusive cost of
legacy::callReadWithVisitorwas dominated byFixedBitWidthEncoding<T>::readWithVisitor, which always decoded values one at a time via the scalar per-value slow path (fixedBitArray_.get(row_++) + baseline_followed by per-valueColumnVisitor::process). This change adds a bulk-scan fast path — mirroring the already-landed canonical implementation in the non-legacyencodings/FixedBitWidthEncoding.h— that handles the dominant dense, no-null, no-filter/hook, 4/8-byte integral ExtractToReader case with a singlebulkGetWithBaselinedecode plusprocessFixedWidthRun, falling back to the unchanged slow path for all other cases. All supporting helpers (readWithVisitorFast,useFastPath,processFixedWidthRun,FixedBitArray) are shared, not duplicated, so behavior is preserved.Differential Revision: D116602815