1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-08 09:42:06 +03:00

Search loss buffer before retransmission buffer when determining if a write is a clone.

Summary:
We maintain the invariant that a buffer cannot be in the loss buffer and retransmission buffers at the same time. As the retransmission buffer holds all unacknowledged data that isn't marked lost, it is very likely to be larger than the loss buffer. This makes the existing case to check for cloning very expensive.

Instead search the loss buffer first, change the search of the loss buffer to a binary search, and elide the double search.

Reviewed By: yangchi

Differential Revision: D18203444

fbshipit-source-id: 66a4e424d61c4b0e3cad12c7eca009ad3d6c5a0d
This commit is contained in:
Matt Joras
2019-10-29 12:32:11 -07:00
committed by Facebook Github Bot
parent d0d75464ca
commit 027fedad5b
3 changed files with 24 additions and 23 deletions

View File

@@ -247,7 +247,7 @@ void dropPackets(QuicServerConnectionState& conn) {
[&streamFrame](const auto& buffer) {
return streamFrame->offset == buffer.offset;
});
EXPECT_TRUE(itr != stream->retransmissionBuffer.end());
ASSERT_TRUE(itr != stream->retransmissionBuffer.end());
stream->lossBuffer.insert(
std::upper_bound(
stream->lossBuffer.begin(),