Skip to content
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(SendStream): remove duplicate buf.is_empty check #1823

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

mxinden
Copy link
Collaborator

@mxinden mxinden commented Apr 15, 2024

SendStream::send_internal starts off with a check to buf.is_empty.

fn send_internal(&mut self, buf: &[u8], atomic: bool) -> Res<usize> {
if buf.is_empty() {
qerror!([self], "zero-length send on stream");
return Err(Error::InvalidInput);
}

Thus the following buf.is_empty check isn't necessary.

let buf = if buf.is_empty() || (self.avail() == 0) {

@larseggert larseggert added this pull request to the merge queue Apr 15, 2024
Merged via the queue into mozilla:main with commit ca1466d Apr 15, 2024
13 checks passed
Copy link

Benchmark results

Performance differences relative to cf00098.

  • drain a timer quickly time: [310.73 ns 318.52 ns 325.70 ns]
    change: [-1.9067% +0.2833% +2.6733%] (p = 0.81 > 0.05)
    No change in performance detected.

  • coalesce_acked_from_zero 1+1 entries
    time: [216.76 ns 217.14 ns 217.57 ns]
    change: [+11.227% +11.748% +12.344%] (p = 0.00 < 0.05)
    💔 Performance has regressed.

  • coalesce_acked_from_zero 3+1 entries
    time: [251.08 ns 251.65 ns 252.24 ns]
    change: [+4.5758% +4.9743% +5.3748%] (p = 0.00 < 0.05)
    💔 Performance has regressed.

  • coalesce_acked_from_zero 10+1 entries
    time: [250.52 ns 254.94 ns 263.87 ns]
    change: [+4.5980% +5.9825% +8.1424%] (p = 0.00 < 0.05)
    💔 Performance has regressed.

  • coalesce_acked_from_zero 1000+1 entries
    time: [225.56 ns 225.81 ns 226.10 ns]
    change: [+2.2059% +2.9200% +3.5889%] (p = 0.00 < 0.05)
    💔 Performance has regressed.

  • RxStreamOrderer::inbound_frame()
    time: [119.98 ms 120.16 ms 120.41 ms]
    change: [+0.9961% +1.2575% +1.5190%] (p = 0.00 < 0.05)
    Change within noise threshold.

  • transfer/Run multiple transfers with varying seeds
    time: [118.05 ms 118.35 ms 118.66 ms]
    thrpt: [33.709 MiB/s 33.797 MiB/s 33.885 MiB/s]
    change:
    time: [-1.0341% -0.6833% -0.3145%] (p = 0.00 < 0.05)
    thrpt: [+0.3155% +0.6880% +1.0449%]
    Change within noise threshold.

  • transfer/Run multiple transfers with the same seed
    time: [119.11 ms 119.28 ms 119.46 ms]
    thrpt: [33.484 MiB/s 33.535 MiB/s 33.582 MiB/s]
    change:
    time: [-0.5077% -0.3102% -0.0952%] (p = 0.00 < 0.05)
    thrpt: [+0.0953% +0.3112% +0.5103%]
    Change within noise threshold.

  • 1-conn/1-100mb-resp (aka. Download)/client
    time: [1.0978 s 1.1055 s 1.1135 s]
    thrpt: [89.810 MiB/s 90.454 MiB/s 91.094 MiB/s]
    change:
    time: [-2.2865% -1.4881% -0.5824%] (p = 0.00 < 0.05)
    thrpt: [+0.5858% +1.5105% +2.3400%]
    Change within noise threshold.

  • 1-conn/10_000-parallel-1b-resp (aka. RPS)/client
    time: [423.52 ms 425.65 ms 427.83 ms]
    thrpt: [23.374 Kelem/s 23.494 Kelem/s 23.612 Kelem/s]
    change:
    time: [-1.7004% -0.9396% -0.1942%] (p = 0.02 < 0.05)
    thrpt: [+0.1946% +0.9486% +1.7298%]
    Change within noise threshold.

  • 1-conn/1-1b-resp (aka. HPS)/client
    time: [50.538 ms 50.812 ms 51.133 ms]
    thrpt: [19.557 elem/s 19.680 elem/s 19.787 elem/s]
    change:
    time: [-0.4236% +0.4634% +1.3910%] (p = 0.33 > 0.05)
    thrpt: [-1.3719% -0.4613% +0.4254%]
    No change in performance detected.

Client/server transfer results

Transfer of 134217728 bytes over loopback.

Client Server CC Pacing Mean [ms] Min [ms] Max [ms] Relative
msquic msquic 404.7 ± 19.2 365.7 437.6 1.00
neqo msquic reno on 813.4 ± 30.4 775.9 884.1 1.00
neqo msquic reno 795.1 ± 27.0 764.9 857.7 1.00
neqo msquic cubic on 807.6 ± 14.0 788.2 826.1 1.00
neqo msquic cubic 801.4 ± 21.0 773.3 836.1 1.00
msquic neqo reno on 4355.8 ± 154.1 4137.4 4594.7 1.00
msquic neqo reno 4313.6 ± 159.2 4111.0 4569.3 1.00
msquic neqo cubic on 4370.1 ± 147.9 4140.3 4563.7 1.00
msquic neqo cubic 4374.2 ± 152.7 4119.0 4577.2 1.00
neqo neqo reno on 3890.4 ± 178.7 3626.8 4148.9 1.00
neqo neqo reno 3337.8 ± 190.7 3103.7 3675.9 1.00
neqo neqo cubic on 4230.4 ± 153.4 3995.8 4433.4 1.00
neqo neqo cubic 4195.1 ± 437.7 3016.9 4529.9 1.00

⬇️ Download logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants