You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delimited is a file written by google in the kythe project to do prefix length delimited read/write operations.
can you see any better reason to use msgio over that ? I don't really see why pools are important..
The text was updated successfully, but these errors were encountered:
So, we need to reuse buffers somehow. If we don't, GC gets very unhappy due to too many short-lived allocations.
delimited does this by reusing a single buffer for each connection. Unfortunately, go-libp2p tends to keep around >500 connections (with a bunch of streams multiplexed on-top) and the messages we send can be up quire large (e.g., 256KiB or even 1MiB). If we had to keep a 256KiB buffer around for each connection, we'd end up wasting a ton of memory.
Instead, msgio reads the length of the next message using a small buffer and then grabs a buffer of the appropriate size from the buffer pool. This way, we don't have to lock-up a large buffer for every idle connection.
https://github.com/google/kythe/blob/master/kythe/go/platform/delimited/delimited.go
Delimited is a file written by google in the kythe project to do prefix length delimited read/write operations.
can you see any better reason to use msgio over that ? I don't really see why pools are important..
The text was updated successfully, but these errors were encountered: