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

feat!: allow stream muxers and connection encrypters to yield lists #2256

Merged
merged 2 commits into from
Nov 25, 2023

Conversation

achingbrain
Copy link
Member

Updates the stream type for MultiaddrConnection to Uint8Array | Uint8ArrayList - this lets us yield Uint8ArrayLists from stream muxers and connection encrypters instead of having to copy the list contents into a new Uint8Array every time.

This lowers the connection latency slightly and increases stream throughput according to the perf test results.

BREAKING CHANGE: the minSendBytes option has been removed from Mplex since the transport can now decide how to optimise sending data

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

Updates the stream type for `MultiaddrConnection` to `Uint8Array | Uint8ArrayList`
- this lets us yield `Uint8ArrayList`s from stream muxers and connection
encrypters instead of having to copy the list contents into a new `Uint8Array`
every time.

This lowers the connection latency slightly and increases stream
throughput according to the [perf test
results](https://observablehq.com/@libp2p-workspace/performance-dashboard?branch=fa6fd4179febbd14ed92d4a7e83d52f729a3af07)
@achingbrain achingbrain requested a review from a team as a code owner November 25, 2023 12:18
@achingbrain achingbrain merged commit 4a474d5 into main Nov 25, 2023
21 checks passed
@achingbrain achingbrain deleted the feat/allow-muxers-and-encrypters-to-yield-lists branch November 25, 2023 13:31
maschad pushed a commit to maschad/js-libp2p that referenced this pull request Nov 27, 2023
…ibp2p#2256)

Updates the stream type for `MultiaddrConnection` to `Uint8Array | Uint8ArrayList` - this lets us yield `Uint8ArrayList`s from stream muxers and connection encrypters instead of having to copy the list contents into a new `Uint8Array` every time.

This lowers the connection latency slightly and increases stream throughput according to the [perf test results](https://observablehq.com/@libp2p-workspace/performance-dashboard?branch=fa6fd4179febbd14ed92d4a7e83d52f729a3af07).

BREAKING CHANGE: the `minSendBytes` option has been removed from Mplex since the transport can now decide how to optimise sending data
This was referenced Jan 18, 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