Skip to content

refactor(tests): Introduce ConnPairBuilder#680

Open
flub wants to merge 2 commits into
mainfrom
flub/conn-pair-builder
Open

refactor(tests): Introduce ConnPairBuilder#680
flub wants to merge 2 commits into
mainfrom
flub/conn-pair-builder

Conversation

@flub
Copy link
Copy Markdown
Collaborator

@flub flub commented May 29, 2026

Description

This introduces a ConnPairBuilder to construct the ConnPair and
switches everything over to use it. The individual ConnPair
construction methods were becoming unwieldy.

There are probably a few style arguments to be had, but the current
code doesn't look to bad. We can keep tweaking this.

Breaking Changes

none

Notes & open questions

split off from #675 and taken a bit further.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.

This introduces a ConnPairBuilder to construct the ConnPair and
switches everything over to use it. The individual ConnPair
construction methods were becoming unwieldy.

There are probably a few style arguments to be had, but the current
code doesn't look to bad. We can keep tweaking this.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

Performance Comparison Report

51b05398c6bedd44f274d0d528416d32da212b41 - artifacts

No results available

---
202950d5ea21a7faf436475efc8bc50710c8fe68 - artifacts

Raw Benchmarks (localhost)

Scenario noq upstream Delta CPU (avg/max)
large-single 5903.3 Mbps 7951.1 Mbps -25.8% 97.1% / 98.7%
medium-concurrent 5226.9 Mbps 7744.3 Mbps -32.5% 95.9% / 97.8%
medium-single 4094.6 Mbps 4646.0 Mbps -11.9% 96.2% / 98.7%
small-concurrent 3880.4 Mbps 5267.0 Mbps -26.3% 97.4% / 99.7%
small-single 3547.6 Mbps 4746.4 Mbps -25.3% 96.7% / 99.0%

Netsim Benchmarks (network simulation)

Condition noq upstream Delta
ideal 3113.5 Mbps 3933.9 Mbps -20.9%
lan 782.3 Mbps 810.4 Mbps -3.5%
lossy 69.8 Mbps 69.8 Mbps ~0%
wan 83.8 Mbps 83.8 Mbps ~0%

Summary

noq is 24.3% slower on average

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/noq/pr/680/docs/noq/

Last updated: 2026-05-29T15:43:17Z

@n0bot n0bot Bot added this to iroh May 29, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh May 29, 2026
Copy link
Copy Markdown
Collaborator

@divagant-martian divagant-martian left a comment

Choose a reason for hiding this comment

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

minor comments :)


/// Sets an explicit [`ServerConfig`].
///
/// Not this means the [`Self::server_transport_cfg`] will be unused.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Not this means the [`Self::server_transport_cfg`] will be unused.
/// Note this means the [`Self::server_transport_cfg`] will be unused.

server_cfg: ServerConfig,
client_cfg: ClientConfig,
) -> Self {
fn with_default_endpoint(server_cfg: ServerConfig, client_cfg: ClientConfig) -> Self {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is this fn worth keeping?

Comment on lines +1473 to +1480
let mut builder = ConnPair::builder().with_multipath();
builder
.server_transport_cfg
.max_concurrent_multipath_paths(6);
builder
.client_transport_cfg
.max_concurrent_multipath_paths(6);
let mut pair = builder.connect();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
let mut builder = ConnPair::builder().with_multipath();
builder
.server_transport_cfg
.max_concurrent_multipath_paths(6);
builder
.client_transport_cfg
.max_concurrent_multipath_paths(6);
let mut pair = builder.connect();
let mut cfg = TransportConfig::default();
cfg.max_concurrent_multipath_paths(6);
let mut pair = ConnPair::builder().with_transport_cfg(cfg).connect();

The with_multipath I think is not doing anything followed by updating the number of paths for both

}

/// Sets an [`EndpointConfig`] for only the server.
pub(super) fn with_server_endpoint_config(mut self, cfg: EndpointConfig) -> Self {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

could we use consistent naming for the config/cfg sufixed methods?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚑 Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants