chore: sync with quinn@main#606
Merged
dignifiedquire merged 24 commits intomainfrom Apr 22, 2026
Merged
Conversation
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/noq/pr/606/docs/noq/ Last updated: 2026-04-22T13:19:16Z |
Performance Comparison Report
|
| Scenario | noq | upstream | Delta | CPU (avg/max) |
|---|---|---|---|---|
| large-single | 5400.1 Mbps | 7843.8 Mbps | -31.2% | 94.4% / 99.5% |
| medium-concurrent | 5517.5 Mbps | 7831.8 Mbps | -29.5% | 94.7% / 99.7% |
| medium-single | 4037.1 Mbps | 4748.6 Mbps | -15.0% | 93.9% / 100.0% |
| small-concurrent | 3830.5 Mbps | 5203.3 Mbps | -26.4% | 99.0% / 152.0% |
| small-single | 3486.3 Mbps | 4870.1 Mbps | -28.4% | 90.9% / 101.0% |
Netsim Benchmarks (network simulation)
| Condition | noq | upstream | Delta |
|---|---|---|---|
| ideal | 3114.6 Mbps | 4079.0 Mbps | -23.6% |
| lan | 782.4 Mbps | 796.4 Mbps | -1.8% |
| lossy | 69.8 Mbps | 65.5 Mbps | +6.7% |
| wan | 83.8 Mbps | 83.8 Mbps | ~0% |
Summary
noq is 25.9% slower on average
79b20f445379515ff085bc8dc940a7118cd1e331 - artifacts
Raw Benchmarks (localhost)
| Scenario | noq | upstream | Delta | CPU (avg/max) |
|---|---|---|---|---|
| large-single | 5380.6 Mbps | 7984.8 Mbps | -32.6% | 97.7% / 149.0% |
| medium-concurrent | 5492.3 Mbps | 7691.6 Mbps | -28.6% | 98.0% / 149.0% |
| medium-single | 4026.5 Mbps | 4749.0 Mbps | -15.2% | 91.9% / 101.0% |
| small-concurrent | 3795.2 Mbps | 5346.2 Mbps | -29.0% | 95.5% / 102.0% |
| small-single | 3561.8 Mbps | 4736.2 Mbps | -24.8% | 97.6% / 153.0% |
Netsim Benchmarks (network simulation)
| Condition | noq | upstream | Delta |
|---|---|---|---|
| ideal | N/A | 4121.0 Mbps | N/A |
| lan | N/A | 810.3 Mbps | N/A |
| lossy | N/A | 62.5 Mbps | N/A |
| wan | N/A | 83.8 Mbps | N/A |
Summary
noq is 27.0% slower on average
flub
approved these changes
Apr 22, 2026
When we store a type-erased, boxed value internally, accepting that value directly allows users to avoid double-boxing. Probably not hugely important in this case, but we've been adopting this pattern everywhere else and we should be consistent. (cherry picked from commit 06f7f7df1be952c41c567ae708b86d127d344c63)
…cUsize Avoids locking the State mutex on every Clone/Drop of a ConnectionRef or EndpointRef: the count now lives on the lockless Shared struct as an AtomicUsize bumped/decremented with Relaxed ordering. Also folds in the two related upstream stream-cleanup changes and ports all four regression tests so the port has coverage for the drop/stop paths. Ports (adapted to noq's double-Arc ConnectionRef and WeakConnectionHandle machinery): - quinn-rs/quinn#2495 @ 404db1bc9, 4b7a03949, 475b55bad (ref-count move; rightward-drift cleanup; RecvStream::drop early return + stream_drop_removes_blocked_reader test) - quinn-rs/quinn#2609 @ 37625fe2d (fix: fetch_sub returns prior value, use >1 / ==1 semantics) - quinn-rs/quinn#2541 @ 803c814 (RecvStream::stop clears blocked_readers + recv_stream_cancel_stop_drop test) - quinn-rs/quinn @ 07ce61cc2 (dropped_endpoint_cleans_up / dropped_connection_cleans_up tests)
(cherry picked from commit 42de9dd2bec578bee21c9e0bf966dee01f8b229b)
(cherry picked from commit 4742a70e336e2d724b5900144d5fb164fbe31a18)
Separate the fast path (`msghdr_x`-based) and slow path (`msghdr`-based) implementations to prepare for runtime dispatch between them. Broken out of #2463 as suggested by @djc. (cherry picked from commit 2964782b4fcc8157755ecf17e439b28f8d4e4fea)
(cherry picked from commit 459c347149e7b20d436aaf29fb5ac320e18e107c)
Suppress table output meant to provide human-friendly visualization when using the `--json` CLI option and its argument is `-`, that is, when the JSON output targets stdout. Fixes #2544. (cherry picked from commit f853e5e0826a00f4b80551986eba0ca251ae1b45)
Add runtime dispatch so callers explicitly opt in to the `sendmsg_x`/`recvmsg_x` fast datapath instead of using it unconditionally. (cherry picked from commit a0ec97a50bdab237450dce97b69a63419ef0ef25)
(cherry picked from commit bb005309e60b1d056d004dca44dee838bcaa13b8)
Instead of creating two throw-away sockets for probing GRO & GSO, use the existing socket that gets passed into `UdpSocketState::new`. Related: #2564 (cherry picked from commit ee8f9469b8b13502cbad587940cf2c36a69bdeef)
(cherry picked from commit 56bba7c0fa393a7aed8b5f99989f02e69cee72a4)
(cherry picked from commit 04ba57c643a573b2cd9a9666a5e5cd92dad05504)
(cherry picked from commit f0905db64178771a62c433c8b0b0e095dfaa8f66)
Clarify in the documentation for `Event::ConnectionLost`, `is_closed()`, and `is_handshaking()` that the `ConnectionLost` event is only emitted when the connection is closed by the peer or due to an error/timeout. When the local application calls `Connection::close()`, no `ConnectionLost` event is emitted; instead, pending operations fail with `ConnectionError::LocallyClosed`. Fixes #1495 (cherry picked from commit 0adcd2053107e302347c4b9741159a7ff0b6c9bb)
(cherry picked from commit b8e4d3b9acf205c5c3304fe901ac40d80408e199)
Replaces the repeated EINTR-retry loop pattern in `send_single`, `send_via_sendmsg_x`, `recv_via_recvmmsg`, and `recv_via_recvmsg_x`. (cherry picked from commit 52c7ad18982e02fa112d6f401572213e08709df6)
After probing the given socket for GSO support, we need to disable this option again to ensure we can selectively enable it via our cmsg codepaths. (cherry picked from commit 8acb578f10b02986050bc600e629f56f40162266)
The fast-apple-datapath feature previously declared `sendmsg_x` and `recvmsg_x` as hard extern "C" symbols. On Apple OS versions where these private APIs don't exist, the dynamic linker would reject the binary at load time. Replace the `extern "C"` block with lazy `OnceLock`-based resolvers using `dlsym`. Both functions now return `Option<Fn>`, and the call sites in `send_via_sendmsg_x` and `recv_via_recvmsg_x` propagate an `Unsupported` error if the symbol is absent. This allows callers to probe availability at runtime before enabling the fast path. (cherry picked from commit e01f99e2658b1d0d7f31930ee014701cb34bc2d0)
(cherry picked from commit eff55728936615479edeb32df3847372fab55c32)
(cherry picked from commit dc8640052a64eb05b463b490b0a0a0f4b0cef9a6)
(cherry picked from commit bda24fdae5a6fa9215ef045498f7946c93011fc9)
5136033 to
79b20f4
Compare
Contributor
Author
|
proptest failure reproduces on |
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.
Synced up to quinn-rs/quinn@07ce61c
Closes #602
Commits applied in this PR
167c709c7e6772ea9f(bundled)e6772ea9f(bundled)RecvStream::drop()e6772ea9f(bundled)RecvStreams fromblocked_readersonstope6772ea9f(bundled)e6772ea9f(bundled)e6772ea9f(bundled)decode_socket_addrhelper2e4effbe4ControlMetadatahelper6f5904350a17058e800c78d64350155ee3f6412dc668498cb0ad67012530527gromodule1174207fa35400c04eConnection::close_reason()documentation287fd2b63Event::ConnectionLostis not emitted on local close7f34b4517461fe7f28retry_if_interruptedhelper348b9138385c022d75sendmsg_x/recvmsg_xviadlsym881d6f151e64abef10max_outgoing_bytes_per_secondoptionffe5a5474e4570ea71Already present in noq
Skipped
AtomicBoolruntime-detection (noq PR #414); upstream's static-bool approach would be redundant.n0-qlogfork with a different API.max_gso_segmentsfor every socket on Windowsmax_gso_segmentsper-socket on anAtomicUsize.