Commit 2be73dc
authored
fix: concatenate encrypted data length prefix with data before sending (#387)
fix: concatenate data length prefix
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/s1 parent 3dee1dc commit 2be73dc
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
0 commit comments