Repository navigation
perf: box rare large variants of HandleResult / Command / Route - #2015
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
|
Metal bench (arm64) failed. 15 of 517 measures outside bounds.
Counters per txn
Microbench: 489 of 504 measures within bounds.
Microbench latency: 30 benches changed more than 3%
Hot code per txn
pooler:
sharding-w2:
Logslb, microbench, pooler, sharding-w2, sharding-w8, verdict.json Compared b2fe858 with d04151f on m8g.metal-24xl (on-demand). |
Contributor
|
Metal bench (x86) failed. 16 of 517 measures outside bounds.
Counters per txn
Microbench: 488 of 504 measures within bounds. Microbench latency: 11 benches changed more than 3%
Hot code per txn
pooler:
sharding-w2:
Logslb, microbench, pooler, sharding-w2, sharding-w8, verdict.json |
jkaczman
force-pushed
the
jk-shrink-moves
branch
2 times, most recently
from
November 11, 2026 20:54
e6e539e to
0888656
Compare
jkaczman
force-pushed
the
jk-shrink-moves
branch
4 times, most recently
from
November 13, 2026 18:46
afae259 to
87be3bd
Compare
jkaczman
force-pushed
the
jk-shrink-moves
branch
from
November 13, 2026 18:54
87be3bd to
6268750
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.
HandleResult,CommandandRoutewere previously pretty large because of a few rare variants and fields (size of a Rust enum is determined by the largest variant within)Previously,
HandleResultwas 528 bytes,Command512 andRoute376.Rust copies the whole value whenever we either return it from a function, or pass it to one, which happens several times per request. E.g., the
?propagation inServer::send_onecopies theHandleResultfor every single message we send to Postgres.Now, these variants and fields are Boxed, making
HandleResult184 bytes,Command336 andRoute304.And, of course, requests that don't use them don't need to allocate the boxes.
Now, 44% fewer bytes are copied per-request, and this removes ~1,200 instructions per request (-1.3%)