Repository navigation
Inline fast path for InputStream::get - #2505
Closed
nikosavola wants to merge 2 commits into
Closed
nikosavola wants to merge 2 commits into
nikosavola wants to merge 2 commits into
Conversation
- get was out-of-line, so byte-wise readers such as the OASIS varint decoder and the GDS2 record reader paid a call per get, two inside a CBLOCK - the inline get serves bytes from the raw buffer and single bytes from the inflate ring buffer, refills and the end of the inflated data stay in get_slow - the last ring slot is left to get_slow too: get rotates the ring there so the read pointer does not wrap, otherwise a following unget(1) asserts - tlStream.h now needs the InflateFilter definition, so tlDeflate.h no longer includes tlStream.h and BitStream::get_byte moved to tlDeflate.cc | case | before ms | after ms | speedup | |---|---:|---:|---:| | oasis_read_vexriscv_compressed | 145.0 | 132.4 | 1.09x | | gds2_read_vexriscv | 135.9 | 127.8 | 1.06x | | oasis_read_vexriscv | 71.5 | 69.9 | 1.02x | Xeon Gold 6248, g++ 13 -O2, before and after alternated for 6 rounds on one pinned core, every round agrees.
This was referenced Oct 14, 2026
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.
InputStream::getwas defined intlStream.cc, so byte-wise readers like the OASIS varint decoder paid a call into the tl library for every byte, two inside a CBLOCKtlStream.h. It serves bytes straight from the read buffer, and single bytes from the inflate ring buffer. Refills, the end of the inflated data and the last ring slot go to the old code, now calledget_slowgetrotates the ring there, so the read pointer does not wrap and a followingunget (1)still works. The OASIS reader does that get/unget pair inmark_start_tabletlStream.hnow needs theInflateFilterdefinition, sotlDeflate.hno longer includestlStream.handBitStream::get_bytemoved totlDeflate.ccXeon Gold 6248, gcc 13 -O2, before and after alternated for 6 rounds on one pinned core, every round agrees.