Repository navigation
perf(transport): pre-size datagram batch buffer - #4042
Closed
codspeed[bot] wants to merge 1 commit into
Closed
codspeed[bot] wants to merge 1 commit into
codspeed[bot] wants to merge 1 commit into
Conversation
Collaborator
|
@codspeedbot check the existing PRs, don't we have an equivalent PR open? |
Contributor
Author
Yes. #3948 (perf: don't allocate in UDP send path, an alternative to the draft #2747) already does what this PR does, and does more.
Both PRs change the same lines in Summary
Learnings updated. See what CodSpeed remembers about this repository. Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
codspeed
Bot
requested review from
KershawChang,
larseggert,
martinthomson,
mxinden and
omansfeld
as code owners
October 6, 2026 08:27
Collaborator
|
Redundant with #3948 |
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
Pre-size the send buffer in
Connection::output_dgram_batch_on_pathto the smaller ofmax_datagrams * plpmtuand the address-family MTU limit. This avoids repeated growth and copying while encoding a datagram batch, including the AEAD expansion and GSO cases. PMTUD probes can still grow the buffer when needed.Validation
cargo +nightly fmt --all -- --checkpassed.cargo check --locked --package neqo-transport --all-targetspassed.cargo test --locked --package neqo-transportpassed: 965 unit tests plus integration suites.cargo test --locked --workspace --exclude mtupassed.mtunetwork-namespace tests fail in this sandbox because the required netns/interface setup is unavailable. These tests are unrelated to this change.CodSpeed
Compared on the same dedicated macro runner using
transfer_walltime:walltime/pacing-false/varying-seeds: +4.32%walltime/pacing-false/same-seed: +3.47%walltime/pacing-true/varying-seeds: +2.59%walltime/pacing-true/same-seed: unchanged within noiseThe comparison reports 3 improvements, 1 unchanged benchmark, and no regressions. View the CodSpeed comparison.
A matched local
transfer_simulatedcomparison was non-regressing but within the simulation noise threshold; the macro-runner walltime result is the validation used here.