Repository navigation
refactor(proto): Avoid PathId allocation when building PATH_ACKS - #901
Merged
Merged
Conversation
When writing PATH_ACK frames into a packet we need to iterate all the paths which have such frames to write. Because of borrowing issues this was allocating a Vec<PathId> each time this happened which is fairly silly. By passing the &mut PacketNumberSpace directly from the iteration this allocation can be avoided, and the iteration is much more sane.
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/noq/pr/901/docs/noq/ Last updated: 2026-11-18T23:26:36Z |
matheus23
approved these changes
Nov 19, 2026
matheus23
left a comment
Member
There was a problem hiding this comment.
yay I like reading PRs like this in these times
emrul
added a commit
to GetAster/noq
that referenced
this pull request
Nov 24, 2026
* upstream/main: (24 commits) refactor(proto): call the std-only float math through crate-root helpers (n0-computer#848) refactor(proto): Avoid PathId allocation when building PATH_ACKS (n0-computer#901) chore: Release chore(deps): fix unused crates warnings of rust 1.100 (n0-computer#899) chore: Update issue template checkboxes (n0-computer#897) chore: humantime is unmaintained (n0-computer#900) chore(ci): fix workflows for test binaries locations (n0-computer#896) fix(perf): don't enable qlog feature in perf binary (n0-computer#850) fix(proto): track the key update boundary per path (n0-computer#869) tests: additional stream affinity tests (n0-computer#890) feat: allow streams to set an affinity for a path, simple version (n0-computer#881) fix(udp): handle receive errors before truncation flags in recv_single (n0-computer#884) chore: Upgrade async-executor and allow warnings in patchbay build (n0-computer#888) chore: Use shared minimal-crates worksflow (n0-computer#862) tests: Increase local slow-tests timeout (n0-computer#860) fix(proto): keep unread data when compacting an unordered stream (n0-computer#867) fix(proto): coalesce contiguous chunks during defragment (n0-computer#866) deps: Bump tokio for RUSTSEC-2026-0386 (n0-computer#868) feat(proto): Implement `noq_proto::SendStream::set_affinity` (n0-computer#836) fix(ci): bump deps for illumos (n0-computer#856) ...
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.
Description
When writing PATH_ACK frames into a packet we need to iterate all the
paths which have such frames to write. Because of borrowing issues
this was allocating a Vec each time this happened which is
fairly silly.
By passing the &mut PacketNumberSpace directly from the iteration this
allocation can be avoided, and the iteration is much more sane.
API Changes
n/a
Notes & open questions
This came out of me trying to understand #879 where this is singled
out as an expensive allocation. It was much simpler to directly make
the PR once I understood what was being described.
Change checklist
cargo makepasses locally.