Optimize peer I/O:

- Limit the lifetime of a buffer that was only used in the early
  phases of peer connection establishment but which lived on as
  long as the peer was active.
- Cache the message used to transfer manifests, so it can be reused
  instead of recreated for every peer connection.
- Improve the reading of partial messages by passing a hint to the
  I/O layer if the number of bytes needed to complete the message
  is known.
This commit is contained in:
Nik Bougalis
2020-11-17 23:20:10 -08:00
parent 8c386ae07e
commit 57ffc58613
8 changed files with 123 additions and 110 deletions

View File

@@ -431,6 +431,9 @@ ManifestCache::applyManifest(Manifest m)
iter->second = std::move(m);
}
// Something has changed. Keep track of it.
seq_++;
return ManifestDisposition::accepted;
}