Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(transport/recovery): optimize
SentPackets::take_ranges
(#2245)
* bench: add SentPackets::take_ranges benchmark * perf(transport/recovery): optimize SentPackets::take_range `SentPackets` keep track of all inflight packets. On receiving an ACK, the acked packet ranges are removed via `SentPackets:take_ranges`. In normal network scenarios one can assume that the amount of packets before a range is small (e.g. due to reordering) or zero, while the amount of packets after a range is large, i.e. all remaining in-flight packets. The previous implementation assumed the opposite, leading to an overhead linear to the amount of packets after the range. This commit changes the algorithm such that it is linear to the amount of packets before the range, which again, is assumed to be smaller than the amount of packets after the acked range. * Update neqo-transport/benches/sent_packets.rs Co-authored-by: Martin Thomson <[email protected]> Signed-off-by: Max Inden <[email protected]> * Update neqo-transport/src/recovery/sent.rs Co-authored-by: Martin Thomson <[email protected]> Signed-off-by: Max Inden <[email protected]> * debug_assert for descending ack ranges * single debug_assert line * Document large `packets` in front of range scenario Co-authored-by: Martin Thomson <[email protected]> * Trigger benchmarks --------- Signed-off-by: Max Inden <[email protected]> Co-authored-by: Martin Thomson <[email protected]>
- Loading branch information