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(udp): move udp mod from neqo-common to neqo-bin #1736

Merged
merged 3 commits into from
Mar 15, 2024

Conversation

mxinden
Copy link
Collaborator

@mxinden mxinden commented Mar 12, 2024

The udp module is only used in the neqo_bin crate, more specifically by the Neqo client and server implementation. This commit moves the udp module to neqo-bin.


Part of #1696.

The `udp` module is only used in the `neqo_bin` crate, more specifically by the
Neqo client and server implementation. This commit moves the `udp` module to
`neqo-bin`.
@larseggert
Copy link
Collaborator

I'll unbreak mutants after dinner

Copy link

github-actions bot commented Mar 14, 2024

Benchmark results

Performance differences relative to 2750423.

  • coalesce_acked_from_zero 1+1 entries
    time: [250.82 ns 251.32 ns 251.87 ns]
    change: [-2.0835% -1.7809% -1.4565%] (p = 0.00 < 0.05)
    💚 Performance has improved.

  • coalesce_acked_from_zero 3+1 entries
    time: [288.51 ns 289.26 ns 290.05 ns]
    change: [-1.2351% -0.9098% -0.5633%] (p = 0.00 < 0.05)
    Change within noise threshold.

  • coalesce_acked_from_zero 10+1 entries
    time: [288.52 ns 289.56 ns 290.77 ns]
    change: [-1.4947% -0.8869% -0.3023%] (p = 0.00 < 0.05)
    Change within noise threshold.

  • coalesce_acked_from_zero 1000+1 entries
    time: [264.96 ns 265.21 ns 265.54 ns]
    change: [-1.6471% -0.9253% -0.0160%] (p = 0.01 < 0.05)
    Change within noise threshold.

  • RxStreamOrderer::inbound_frame()
    time: [126.52 ms 126.60 ms 126.68 ms]
    change: [-0.6792% -0.4848% -0.3432%] (p = 0.00 < 0.05)
    Change within noise threshold.

  • Run multiple transfers with varying seeds
    time: [187.61 ms 188.28 ms 188.94 ms]
    change: [-2.5084% -2.0162% -1.5498%] (p = 0.00 < 0.05)
    💚 Performance has improved.

  • Run multiple transfers with the same seed
    time: [188.62 ms 189.05 ms 189.49 ms]
    change: [-2.1227% -1.8248% -1.5277%] (p = 0.00 < 0.05)
    💚 Performance has improved.

⬇️ Download logs

@mxinden mxinden marked this pull request as ready for review March 14, 2024 09:29
Comment on lines -64 to +63
contents: d.into_data().into(),
contents: Vec::from(d).into(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this part of the move or another change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Datagram::into_data is changed to a From<Datagram> for Vec<u8> (see comment below). Instead of calling into_data, this line first leverages the new From implementation and then, as before, converts it into a Bytes (into at the end).

None of these methods allocate.

Comment on lines +80 to +85
impl From<Datagram> for Vec<u8> {
fn from(datagram: Datagram) -> Self {
datagram.d
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this part of the move or another change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The udp module needs to convert a Datagram to a Vec. Previously this would have been done via the pub(crate) Datagram::into_data.

Given that udp module is moved outside of neqo-common crate now, pub(crate) into_data is changed into a pub From<Datagram> for Vec<u8> implementation. See also #1695 (comment).

Long story short, this just exposes into_data beyond the crate and implements it as a From instead.

@larseggert larseggert added this pull request to the merge queue Mar 15, 2024
Merged via the queue into mozilla:main with commit 177385e Mar 15, 2024
13 checks passed
@mxinden mxinden mentioned this pull request Mar 26, 2024
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