-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(transport/recovery): optimize SentPackets::take_ranges
#2245
Conversation
`SentPackets` keep track of all inflight packets. On receiving an ACK, the acked packet ranges are removed via `SentPackets:take_ranges`. In normal network scenarios one can assume that the amount of packets before a range is small (e.g. due to reordering) or zero, while the amount of packets after a range is large, i.e. all remaining in-flight packets. The previous implementation assumed the opposite, leading to an overhead linear to the amount of packets after the range. This commit changes the algorithm such that it is linear to the amount of packets before the range, which again, is assumed to be smaller than the amount of packets after the acked range.
28ecab5
to
1de870b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2245 +/- ##
=======================================
Coverage 95.37% 95.37%
=======================================
Files 112 112
Lines 36567 36593 +26
=======================================
+ Hits 34876 34902 +26
Misses 1691 1691 ☔ View full report in Codecov by Sentry. |
Failed Interop TestsQUIC Interop Runner, client vs. server neqo-latest as client
neqo-latest as server
All resultsSucceeded Interop TestsQUIC Interop Runner, client vs. server neqo-latest as client
neqo-latest as server
Unsupported Interop TestsQUIC Interop Runner, client vs. server neqo-latest as client
neqo-latest as server
|
Co-authored-by: Martin Thomson <[email protected]> Signed-off-by: Max Inden <[email protected]>
Co-authored-by: Martin Thomson <[email protected]> Signed-off-by: Max Inden <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Land the other first, but this is good to go.
Benchmark resultsPerformance differences relative to baae4f2. coalesce_acked_from_zero 1+1 entries: No change in performance detected.time: [99.203 ns 99.489 ns 99.775 ns] change: [-0.5171% -0.0372% +0.4029%] (p = 0.88 > 0.05) coalesce_acked_from_zero 3+1 entries: No change in performance detected.time: [116.89 ns 117.16 ns 117.46 ns] change: [-0.5668% -0.2380% +0.1027%] (p = 0.16 > 0.05) coalesce_acked_from_zero 10+1 entries: No change in performance detected.time: [116.61 ns 116.98 ns 117.45 ns] change: [-1.4302% -0.6613% -0.0212%] (p = 0.07 > 0.05) coalesce_acked_from_zero 1000+1 entries: No change in performance detected.time: [97.521 ns 97.675 ns 97.847 ns] change: [-0.6665% +0.3071% +1.2996%] (p = 0.58 > 0.05) RxStreamOrderer::inbound_frame(): Change within noise threshold.time: [111.80 ms 111.85 ms 111.91 ms] change: [-0.1564% -0.0844% -0.0141%] (p = 0.02 < 0.05) SentPackets::take_ranges: :green_heart: Performance has improved.time: [5.5127 µs 5.5878 µs 5.6587 µs] change: [-96.565% -96.506% -96.434%] (p = 0.00 < 0.05) transfer/pacing-false/varying-seeds: No change in performance detected.time: [26.109 ms 27.003 ms 27.900 ms] change: [-8.9420% -3.8017% +1.2448%] (p = 0.15 > 0.05) transfer/pacing-true/varying-seeds: No change in performance detected.time: [35.101 ms 36.688 ms 38.306 ms] change: [-4.5918% +1.3010% +7.4725%] (p = 0.68 > 0.05) transfer/pacing-false/same-seed: Change within noise threshold.time: [25.358 ms 26.150 ms 26.933 ms] change: [-8.2356% -4.4806% -0.2481%] (p = 0.03 < 0.05) transfer/pacing-true/same-seed: No change in performance detected.time: [40.601 ms 42.542 ms 44.560 ms] change: [-10.928% -4.8190% +1.4345%] (p = 0.15 > 0.05) 1-conn/1-100mb-resp/mtu-1504 (aka. Download)/client: 💚 Performance has improved.time: [874.51 ms 884.07 ms 893.81 ms] thrpt: [111.88 MiB/s 113.11 MiB/s 114.35 MiB/s] change: time: [-5.1108% -3.6084% -2.0380%] (p = 0.00 < 0.05) thrpt: [+2.0804% +3.7434% +5.3861%] 1-conn/10_000-parallel-1b-resp/mtu-1504 (aka. RPS)/client: No change in performance detected.time: [318.59 ms 321.46 ms 324.31 ms] thrpt: [30.834 Kelem/s 31.109 Kelem/s 31.388 Kelem/s] change: time: [-0.7082% +0.7507% +2.0715%] (p = 0.29 > 0.05) thrpt: [-2.0295% -0.7451% +0.7133%] 1-conn/1-1b-resp/mtu-1504 (aka. HPS)/client: No change in performance detected.time: [33.800 ms 34.013 ms 34.245 ms] thrpt: [29.202 elem/s 29.401 elem/s 29.586 elem/s] change: time: [+0.0083% +0.7955% +1.6139%] (p = 0.06 > 0.05) thrpt: [-1.5883% -0.7892% -0.0083%] 1-conn/1-100mb-resp/mtu-1504 (aka. Upload)/client: Change within noise threshold.time: [1.6550 s 1.6761 s 1.6981 s] thrpt: [58.888 MiB/s 59.664 MiB/s 60.422 MiB/s] change: time: [+0.6461% +2.5232% +4.4351%] (p = 0.01 < 0.05) thrpt: [-4.2468% -2.4611% -0.6419%] Client/server transfer resultsTransfer of 33554432 bytes over loopback.
|
For the record, highlighting the performance improvement of this pull request compared to baseline
|
We got to figure out these issues with |
Agreed. @larseggert I will look into it once I am done releasing Neqo v0.11.0 (#2239). |
SentPackets
keep track of all inflight packets. On receiving an ACK, the ackedpacket ranges are removed via
SentPackets:take_ranges
.In normal network scenarios one can assume that the amount of packets before a
range is small (e.g. due to reordering) or zero, while the amount of packets
after a range is large, i.e. all remaining in-flight packets.
The previous implementation assumed the opposite, leading to an overhead linear
to the amount of packets after the range. This commit changes the algorithm such
that it is linear to the amount of packets before the range, which again, is
assumed to be smaller than the amount of packets after the acked range.
Fixes #2242.