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

Optimize ACK frame writing

Summary:
Previously we stored an `IntervalSet` in each `WriteAckFrame`. We don't need to do this, as by the time we are writing an `ACK` the `IntervalSet` is complete. Instead of bothering with the `IntervalSet` operations, we can simply serialize it to a reverse-sorted `vector.`

Additionally this has some micro-optimizations for filling the ACK frame, with a new function for getting varint size.

Reviewed By: yangchi

Differential Revision: D19397728

fbshipit-source-id: ba6958fb36a4681edaa8394b1bcbbec3472e177d
This commit is contained in:
Matt Joras
2020-01-16 10:39:17 -08:00
committed by Facebook Github Bot
parent 6cefc60e8d
commit 431acc838f
22 changed files with 151 additions and 114 deletions

View File

@@ -355,7 +355,7 @@ TEST_F(QuicPacketSchedulerTest, WriteOnlyOutstandingPacketsTest) {
"The sun is in the sky.");
MaxStreamsFrame maxStreamFrame(999, true);
PingFrame pingFrame;
WriteAckFrame::AckBlocks ackBlocks;
AckBlocks ackBlocks;
ackBlocks.insert(10, 100);
ackBlocks.insert(200, 1000);
AckFrameMetaData ackMeta(ackBlocks, 0us, kDefaultAckDelayExponent);