Fix graft_child_maps below a long root path - #131
Merged
luketpeterson merged 3 commits intoSep 25, 2026
Merged
luketpeterson merged 3 commits into
luketpeterson merged 3 commits into
Conversation
with_node_at_path joined the focus's node key and the child path in a fixed MAX_NODE_KEY_BYTES buffer, so a root path of 48 bytes or more overflowed it. Fall back to a heap buffer.
… in an unsupported context. The PR's original fix was to remove that limitation, but it did it by allocating a temporary buffer in a situation that could have been a tight loop! This commit fixes the internal function correctly (without the perf foot-gun), and now, as was always the plan, we can use that function to streamling PathMap value insertion (up to 20%)
Collaborator
Author
|
Yeah, I agree allocating in a buffer was unnecessary. |
Picking up another 10% on PathMap::set_val_at by skipping the temporary WZ creation
Collaborator
|
Merging. I'm not cherry-picking this back to the 0.3.4 release branch because I chose to modify the API (added a method to a trait (WriteZipper) that could have been implemented externally) Reasons I'm not worried to let the original bug persist in
|
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.
with_node_at_path joined the focus's node key and the child path in a fixed MAX_NODE_KEY_BYTES buffer, so a root path of 48 bytes or more overflowed it. Fall back to a heap buffer.