Skip to content

Conversation

@rklaehn
Copy link

@rklaehn rklaehn commented Dec 12, 2025

Description

Replace SendBuffer::get with get_into that scans the entire buffer and copies the relevant range to a &mut impl BufMut.
This turns the O(N*K) when the buffer consists of many tiny slices to O(N).

Also does some refactoring to prepare for a mutable buffer at the end, and renames some variables.

Breaking Changes

None

Notes & open questions

Q: Should we keep the "test" for O(NK) behaviour?
Q: is it ok to panic when misused? Before this would have led to an endless loop.

@rklaehn rklaehn changed the title maiFix send buffer fix(quinn-proto): prevent O(N^2) behaviour when sending a lot of small values in SendBuffer Dec 12, 2025
@n0bot n0bot bot added this to iroh Dec 12, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Dec 12, 2025
@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 75.37313% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.60%. Comparing base (1b96a5f) to head (7d9c0e4).

Files with missing lines Patch % Lines
quinn-proto/src/connection/send_buffer.rs 75.18% 33 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #247      +/-   ##
==========================================
- Coverage   76.66%   76.60%   -0.06%     
==========================================
  Files          83       83              
  Lines       23347    23432      +85     
==========================================
+ Hits        17898    17950      +52     
- Misses       5449     5482      +33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Dec 16, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/quinn/pr/247/docs/iroh_quinn/

Last updated: 2025-12-22T14:09:07Z

@rklaehn rklaehn requested a review from flub December 16, 2025 12:16
@rklaehn rklaehn changed the base branch from main-iroh to main December 16, 2025 12:34
}

#[cfg(test)]
mod tests {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we could have some proptests? 😅 they have been very good at making sure things have less bugs

@flub flub removed their request for review December 22, 2025 10:34
@flub
Copy link
Collaborator

flub commented Dec 22, 2025

Removed myself from review, would love to see this merged but I don't think I have much helpful impact on this. Feel free to re-request if needed.

(also, can this be merged yet? 😀 )

@flub flub added the performance Things that might improve performance both for iroh and as a normal QUIC library. label Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Things that might improve performance both for iroh and as a normal QUIC library.

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

5 participants