-
Notifications
You must be signed in to change notification settings - Fork 126
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
refactor(udp): pass SocketAddr instead of &SocketAddr #2169
Conversation
`SocketAddr` implements `Copy`. https://doc.rust-lang.org/std/net/enum.SocketAddr.html#impl-Copy-for-SocketAddr Thus there is no need to pass by reference instead of by value.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2169 +/- ##
=======================================
Coverage 95.39% 95.39%
=======================================
Files 112 112
Lines 36373 36373
=======================================
Hits 34697 34697
Misses 1676 1676 ☔ 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
|
Is the size of the object a concern? |
Benchmark resultsPerformance differences relative to 944c817. coalesce_acked_from_zero 1+1 entries: Change within noise threshold.time: [98.527 ns 98.857 ns 99.199 ns] change: [-1.8080% -1.1772% -0.6129%] (p = 0.00 < 0.05) coalesce_acked_from_zero 3+1 entries: Change within noise threshold.time: [116.43 ns 116.78 ns 117.18 ns] change: [-1.2359% -0.8200% -0.3878%] (p = 0.00 < 0.05) coalesce_acked_from_zero 10+1 entries: No change in performance detected.time: [116.07 ns 116.41 ns 116.83 ns] change: [-1.2941% -0.0446% +2.1546%] (p = 0.97 > 0.05) coalesce_acked_from_zero 1000+1 entries: No change in performance detected.time: [97.543 ns 97.735 ns 97.949 ns] change: [-1.3610% -0.4712% +0.2919%] (p = 0.31 > 0.05) RxStreamOrderer::inbound_frame(): 💚 Performance has improved.time: [110.88 ms 110.95 ms 111.02 ms] change: [-2.5507% -2.4824% -2.4168%] (p = 0.00 < 0.05) transfer/pacing-false/varying-seeds: No change in performance detected.time: [26.577 ms 27.720 ms 28.858 ms] change: [-5.6210% -0.2744% +5.6039%] (p = 0.92 > 0.05) transfer/pacing-true/varying-seeds: No change in performance detected.time: [34.887 ms 36.553 ms 38.245 ms] change: [-6.2326% -0.1268% +6.4316%] (p = 0.97 > 0.05) transfer/pacing-false/same-seed: No change in performance detected.time: [26.070 ms 26.851 ms 27.637 ms] change: [-2.0055% +2.1267% +6.4813%] (p = 0.33 > 0.05) transfer/pacing-true/same-seed: No change in performance detected.time: [41.459 ms 43.353 ms 45.298 ms] change: [-8.8390% -3.0180% +3.2661%] (p = 0.34 > 0.05) 1-conn/1-100mb-resp (aka. Download)/client: No change in performance detected.time: [113.28 ms 120.00 ms 133.03 ms] thrpt: [751.70 MiB/s 833.34 MiB/s 882.80 MiB/s] change: time: [-0.0167% +6.0692% +17.794%] (p = 0.24 > 0.05) thrpt: [-15.106% -5.7219% +0.0167%] 1-conn/10_000-parallel-1b-resp (aka. RPS)/client: No change in performance detected.time: [313.14 ms 316.62 ms 320.05 ms] thrpt: [31.245 Kelem/s 31.584 Kelem/s 31.935 Kelem/s] change: time: [-0.3396% +1.3136% +2.9697%] (p = 0.11 > 0.05) thrpt: [-2.8840% -1.2966% +0.3408%] 1-conn/1-1b-resp (aka. HPS)/client: No change in performance detected.time: [33.975 ms 34.158 ms 34.353 ms] thrpt: [29.110 elem/s 29.275 elem/s 29.433 elem/s] change: time: [-0.3069% +0.4794% +1.2889%] (p = 0.24 > 0.05) thrpt: [-1.2725% -0.4771% +0.3079%] Client/server transfer resultsTransfer of 33554432 bytes over loopback.
|
The size is 32 bytes. I would be surprised if this has a performance impact, especially in the context of making a syscall. Am I missing something? |
SocketAddr
implementsCopy
.https://doc.rust-lang.org/std/net/enum.SocketAddr.html#impl-Copy-for-SocketAddr
Thus there is no need to pass by reference instead of by value.
Broken out of #2093.