Sending lots of tiny buffers kills TCP performance, even with noDelay disabled.
Sending the encrypted data length along with the data in one buffer increases @libp2p/perf throughput with noise+yamux from 300-320 MB/s to 320-340 MB/s
Flame graphs showing Socket._writeGeneric (e.g. writing to the TCP socket) while running the performance test:
Sending lots of tiny buffers kills TCP performance, even with
noDelay
disabled.Sending the encrypted data length along with the data in one buffer increases
@libp2p/perf
throughput with noise+yamux from 300-320 MB/s to 320-340 MB/sFlame graphs showing
Socket._writeGeneric
(e.g. writing to the TCP socket) while running the performance test:Before:
After: