Closed achingbrain closed 7 months ago
N.b depends on "next"
versions of @libp2p/interface
and friends, they'll need to be released before this is merged.
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
f2492e9
) 95.60% compared to head (9a48fd3
) 95.60%. Report is 1 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:tada: This PR is included in version 6.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
The general pattern of stream muxers is to yield protocol stream data framed by some additional metadata - stream id, flags, etc.
The frame data can be prepended/appended to the protocol stream data by using a
Uint8ArrayList
instead of aUint8Array
, this removes the need to copy the protocol data into a newUint8Array
for every frame.The new
@libp2p/interface
version allows muxers to emitUint8ArrayList
s as well asUint8Array
s so we can send protocol stream data to a transport in a no-copy operation.In particular yielding a single
Uint8ArrayList
with the frame header plus the data buffer gets us close to that target 200ms connection establishment time:BREAKING CHANGE: requires
js-libp2p@1.0.0