Skip to content

Mux performance improvements#5093

Merged
karknu merged 13 commits intomainfrom
karknu/main_read_buffer
Mar 27, 2025
Merged

Mux performance improvements#5093
karknu merged 13 commits intomainfrom
karknu/main_read_buffer

Conversation

@karknu
Copy link
Contributor

@karknu karknu commented Mar 7, 2025

Description

This PR consist of a series of commits aimed to make Mux more efficient.
Mainly this is done by attempting to read and write larger chunks of data.

Checklist

Quality

  • Commit sequence makes sense and have useful messages, see ref.
  • New tests are added and existing tests are updated.
  • Self-reviewed the PR.

Maintenance

  • Linked an issue or added the PR to the current sprint of ouroboros-network project.
  • Added labels.
  • Updated changelog files.
  • The documentation has been properly updated, see ref.

@github-project-automation github-project-automation bot moved this to In Progress in Ouroboros Network Mar 7, 2025
@karknu karknu force-pushed the karknu/main_read_buffer branch 2 times, most recently from aa52d92 to a274cc2 Compare March 7, 2025 08:26
@karknu karknu marked this pull request as ready for review March 7, 2025 08:40
@karknu karknu requested a review from a team as a code owner March 7, 2025 08:40
@coot coot added the mux issues related to network-mux label Mar 7, 2025
Copy link
Collaborator

@coot coot left a comment

Choose a reason for hiding this comment

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

I did the first pass, the PR looks nice.

@karknu karknu force-pushed the karknu/main_read_buffer branch 12 times, most recently from 40e5b35 to 93b4382 Compare March 14, 2025 10:57
@coot coot moved this from In Progress to In Review in Ouroboros Network Mar 19, 2025
@coot coot changed the title Mux Improvements Mux performance improvements Mar 19, 2025
Copy link
Collaborator

@coot coot left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor comments.

Copy link
Contributor

@crocodile-dentist crocodile-dentist left a comment

Choose a reason for hiding this comment

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

lgtm

karknu added 2 commits March 26, 2025 09:22
Lower level benchmark for reading and writing over Sockets.
Uses local TCP sockets over ephemeral ports.
Enforce at least 1 byte payload data per SDU.
karknu added 9 commits March 26, 2025 09:24
Define msHeaderLength and use it instead of 8 as hardcoded headerlength.
Permit sending of multiple SDUs through a single call to sendMany for
Socket bearers
Bearers without vector IO support emulate it through multiple calls to
write.
This implements an optional read buffer for the Socket bearer.
If provided with a read buffer the socket bearer will
read as much data available on the socket that can fit in the read
buffer. Subsequent read requests will first be served data from the
buffer.
Implement buffered and unbuffered mux/demux tests for the socket bearer.
Poll the egress queue at most 1000 times per second.
This gives us an oppertunity to pack multiple messages into larger SDUs,
and write those SDUs with a single sendMany call.
Use a Builder for ingress. Messages shorter than 128 bytes will be copied.
@karknu karknu force-pushed the karknu/main_read_buffer branch from 40d7c99 to edca550 Compare March 26, 2025 08:32
@karknu karknu added this pull request to the merge queue Mar 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 26, 2025
Use RecvLowWater to signal that we want to read at least the length of
the SDU.
@karknu karknu force-pushed the karknu/main_read_buffer branch from 225d73a to 5dd391e Compare March 26, 2025 14:52
@karknu karknu enabled auto-merge March 26, 2025 15:34
@karknu karknu force-pushed the karknu/main_read_buffer branch from 5dd391e to 93ba932 Compare March 26, 2025 21:57
@karknu karknu force-pushed the karknu/main_read_buffer branch from 93ba932 to 0175d27 Compare March 27, 2025 06:56
@karknu karknu added this pull request to the merge queue Mar 27, 2025
Merged via the queue into main with commit 1c8c31f Mar 27, 2025
11 of 13 checks passed
@karknu karknu deleted the karknu/main_read_buffer branch March 27, 2025 07:38
@github-project-automation github-project-automation bot moved this from In Review to Done in Ouroboros Network Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mux issues related to network-mux

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants