encodings/fsst: add OptimizedDecompressor for throughput#7485
Open
joseph-isaacs wants to merge 1 commit intodevelopfrom
Open
encodings/fsst: add OptimizedDecompressor for throughput#7485joseph-isaacs wants to merge 1 commit intodevelopfrom
joseph-isaacs wants to merge 1 commit intodevelopfrom
Conversation
Replaces the default fsst-rs decompressor with a hand-tuned version that processes compressed codes in 32-code blocks using SWAR escape detection, pre-converts symbol table entries to u64 to eliminate per-lookup conversions, and uses runtime BMI1/BMI2/POPCNT dispatch on x86-64. Signed-off-by: Joe Isaacs <joe@spiraldb.com>
Merging this PR will improve performance by 19.89%
Performance Changes
Comparing Footnotes
|
Contributor
|
if this ends up being a perf win we should migrate this to fsst-rs imho |
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
OptimizedDecompressorinencodings/fsst/src/decompressor.rs, replacing the defaultfsst-rsdecompressor in the canonicalization pathu64for0xFFin a single branchless operationu64at construction time (~2.3KB total, fits in L1 cache), eliminatingSymbol::to_u64()per lookupTest plan
decompressor.rscover: basic decompression, escape codes, empty input, matches baseline on random strings, matches baseline on full-byte-range inputs with many escapes, large corpus correctnesscargo test -p vortex-fsstcargo bench -p vortex-fsst --bench fsst_compress -- decompress_fsstto observe throughput improvement🤖 Generated with Claude Code