Repository navigation
perf(writer): bit-packing encode ~45% faster, byte-identical (#475) - #480
Merged
Merged
Conversation
…475) - packFastLanes builds each lane's words in a register and stores a block at a time: no read-back of the segment, and the per-width store switch runs once per block instead of once per word. - Min/max and the bit-width histogram share one pass: the loop is memory-bound, so one read of the values beats a separately vectorized min/max pass. - The patch count comes from the histogram: no scan when there are no patches, and exact-size primitive arrays instead of boxed lists. 10M values at 11 bits: U16/U32/U64 37/40/36 -> 22/20/18 ms; output SHA-256 unchanged over every ptype, widths, lengths 0..5000 and patches. JMH javaWriteCascading (-f 3): 0.902 -> 0.939 ops/s. A four-way interleaved histogram was tried and measured no gain. The new multi-block test also decodes patched arrays, which the existing tests never did (their registry had no primitive decoder). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015R8cf8YM8XFQqrkyhSAtYr
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.
Microbench (10M values, 11 bits): U16/U32/U64 37/40/36 → 22/20/18 ms. Output SHA-256 unchanged across every ptype, widths, lengths 0..5000, with patches. JMH
javaWriteCascading-f 3: 0.902 → 0.939 ops/s.Not done: taking min/max from the cascade's stats as Rust does — needs an
EncodingEncoderAPI change, and the fused pass already removes most of that cost.Closes #475
🤖 Generated with Claude Code
https://claude.ai/code/session_015R8cf8YM8XFQqrkyhSAtYr