Repository navigation
Speed up PackedGraph construction - #244
Merged
Merged
Conversation
…acked accessors PackedVector grows its capacity by 1.25x, and each growth went through repack(), which built a new int_vector and copied every element across through sdsl's reference proxies -- even when the width was unchanged and a realloc would do. New pages of a PagedVector also start 1 bit wide and widen several times, each widening another full proxy copy, and every growth then zeroed its new entries one at a time. - repack() at an unchanged width now just resizes the int_vector - widening uses sdsl::util::expand_width, which works in place on raw words - new entries are zeroed a word at a time (the mapped backend keeps the per-element loop) Stored contents, widths and serialized bytes are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
CMakeLists.txt moved to C++20 with the contraction hierarchy code (ch.hpp uses operator<=> and std::ranges), but the Makefile still asked for C++17, so a plain `make` no longer builds. vg is unaffected, since it appends its own -std=c++20 after ours, but libbdsg-easy uses the Makefile's default. CompatIntVector's out-of-line begin()/end() also need `typename` on their dependent return type before C++20, which broke anything including packed_graph.hpp at an older standard. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 24, 2026
adhirakunnath-hue
pushed a commit
to adhirakunnath-hue/vg
that referenced
this pull request
Oct 21, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Making
PackedGraphs(for modifyting with vg) is becoming a bottleneck in minigraph-cactus. Here is a relatively simple change that gets about 3X speedup on some tests:From Claude:
Stop PackedVector growth from copying every element through the bit-p…acked accessors
PackedVector grows its capacity by 1.25x, and each growth went through repack(), which built a new int_vector and copied every element across through sdsl's reference proxies -- even when the width was unchanged and a realloc would do. New pages of a PagedVector also start 1 bit wide and widen several times, each widening another full proxy copy, and every growth then zeroed its new entries one at a time.
Stored contents, widths and serialized bytes are unchanged.