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
{{ message }}
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
The sending of topology gossip currently goes through four layers of gob encoding, and involves n_peers+3 encoders...
1. one GobEncoder for each peer, into which we encode the connections
2. one GobEncoder for the set of peers, into which all peers are
encoded, with their connection information represented by the
result of the aforementioned encoding.
3. one GobEncoder for encoding the gossip (hash, source, and the
result of (2)) as a ProtocolMsg payload.
4. one GobEncoder in the TCPSender, which is used to encode a byte
slice - comprising the ProtocolMsg tag and payload - as a single
message
This has a bad design smell to it and probably is also rather inefficient.
The text was updated successfully, but these errors were encountered:
Two layers of gob is the best we can do when crypto is enabled. Our crypto operates on message streams, i.e. streams of byte slices, rather than byte streams. The 4th gob layer converts between the two. And the 3rd layer converts between our protocol data objects and byte slices.
We could do something different in the non-crypto case but it's really not worth the hassle.
The gob codec takes up ~12%, in what is an extremely gob-heavy scenario. So while there is still room for improvement, it's not worth spending a lot of effort on it. So the main motivation to eliminate another layer would be improved design/APIs.
The sending of topology gossip currently goes through four layers of gob encoding, and involves n_peers+3 encoders...
encoded, with their connection information represented by the
result of the aforementioned encoding.
result of (2)) as a ProtocolMsg payload.
slice - comprising the ProtocolMsg tag and payload - as a single
message
This has a bad design smell to it and probably is also rather inefficient.
The text was updated successfully, but these errors were encountered: