Use pod_vector for mmap zero-copy support in serialized data structures#12
Open
adamant-pwn wants to merge 1 commit intojermp:mainfrom
Open
Use pod_vector for mmap zero-copy support in serialized data structures#12adamant-pwn wants to merge 1 commit intojermp:mainfrom
adamant-pwn wants to merge 1 commit intojermp:mainfrom
Conversation
- bit_vector, compact_vector, rank9, darray: rename pod_vector -> owning_span - cache_line_elias_fano, endpoints_sequence: refactor encode() to build into local std::vector then freeze via owning_span move-construction - Builder swap patterns converted to move-assignment - Update essentials submodule
d8f2afd to
012ef0c
Compare
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 PR replaces
std::vectorwithessentials::pod_vectorin all serialized data structure members acrossbits. This is a companion to jermp/essentials#11, which introducespod_vectorand mmap zero-copy loading support ingeneric_loader.No behavioral change for existing code —
pod_vectoris a drop-in replacement forstd::vectorwhen used in owned mode (the default). The change enables downstream applications to usegeneric_loader::set_mmap()to deserialize these data structures via zero-copy views into memory-mapped files. See the essentials PR for full motivation, benchmarks, and design details.Changes
bit_vector.hppm_bitsstd::vector<uint64_t>pod_vector<uint64_t>compact_vector.hppm_bitsstd::vector<uint64_t>pod_vector<uint64_t>rank9.hppm_block_rank_pairsstd::vector<uint64_t>pod_vector<uint64_t>darray.hppm_positionsstd::vector<uint64_t>pod_vector<uint64_t>cache_line_elias_fano.hppm_datastd::vector<uint8_t>pod_vector<uint8_t>endpoints_sequence.hppm_hints_0std::vector<uint8_t>pod_vector<uint8_t>Additionally,
darray.hpptemplatizesaccess()andat()to accept bothconst uint64_t*andpod_vector<uint64_t>::const_iteratorfor const correctness.Depends on: jermp/essentials#11