Repository navigation
perf(router): store subgraph operation text as a boxed str - #1535
Merged
Merged
Conversation
kamilkisiela
added this pull request to stack #1534
September 10, 2026 11:45
|
🐋 This PR was built and pushed to the following Docker images: Image Names: Platforms: Image Tags: |
kamilkisiela
marked this pull request as ready for review
September 10, 2026 13:55
kamilkisiela
marked this pull request as draft
September 10, 2026 13:55
kamilkisiela
marked this pull request as ready for review
September 10, 2026 16:22
dotansimha
approved these changes
Sep 10, 2026
kamilkisiela
force-pushed
the
kamil-qp-cache-pr4
branch
from
September 11, 2026 09:12
e332663 to
68eb9c0
Compare
`document_str` is rendered once when the plan is built and never appended to,
but a `String` keeps whatever capacity its doubling growth last landed on.
Measured over the bench plan's seven fetches, that is 1484 B allocated for 897 B
of text - 587 B, or 39.6%, held for the life of the cache entry to no purpose.
Box it. The struct field also drops the capacity word:
SubgraphFetchOperation 40 -> 32 B
FetchNode 216 -> 208 B
BatchFetchNode 168 -> 160 B
`PlanNode` does not move. Two commits ago it would have: the fetch-carrying
variants were still inline then, so this 8 B would have come off every slot of
every `Sequence` and `Parallel`. Boxing those variants took that path away, and
what is left is 8 B per fetch rather than 8 B per node. The heap saving above is
per fetch either way, and is the larger half.
Nothing had to change to accommodate it beyond one `as_str()` call: the subgraph
request borrows the text and splices the operation name by position when it
builds the request body, so the text itself is never mutated in place.
kamilkisiela
force-pushed
the
kamil-qp-cache-pr4
branch
from
September 11, 2026 10:55
68eb9c0 to
ecce78f
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.
No description provided.