Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Unified Diff: net/quic/congestion_control/time_loss_algorithm.cc

Issue 514033002: Optimize QuicUnackedPacketMap by changing from a LinkedHashMap to a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unit_test_for_empty_packet_74041239
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/congestion_control/tcp_loss_algorithm.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/time_loss_algorithm.cc
diff --git a/net/quic/congestion_control/time_loss_algorithm.cc b/net/quic/congestion_control/time_loss_algorithm.cc
index d23deadf118599d743bd42915ddf9ca3ca966d03..3a7b42d40879bfbfc54c8f7cb889ca5aae6ee39a 100644
--- a/net/quic/congestion_control/time_loss_algorithm.cc
+++ b/net/quic/congestion_control/time_loss_algorithm.cc
@@ -39,22 +39,24 @@ SequenceNumberSet TimeLossAlgorithm::DetectLostPackets(
QuicTime::Delta::Max(rtt_stats.SmoothedRtt(), rtt_stats.latest_rtt())
.Multiply(kLossDelayMultiplier));
+ QuicPacketSequenceNumber sequence_number = unacked_packets.GetLeastUnacked();
for (QuicUnackedPacketMap::const_iterator it = unacked_packets.begin();
- it != unacked_packets.end() && it->first <= largest_observed; ++it) {
- if (!it->second.in_flight) {
+ it != unacked_packets.end() && sequence_number <= largest_observed;
+ ++it, ++sequence_number) {
+ if (!it->in_flight) {
continue;
}
- LOG_IF(DFATAL, it->second.nack_count == 0)
+ LOG_IF(DFATAL, it->nack_count == 0)
<< "All packets less than largest observed should have been nacked.";
// Packets are sent in order, so break when we haven't waited long enough
// to lose any more packets and leave the loss_time_ set for the timeout.
- QuicTime when_lost = it->second.sent_time.Add(loss_delay);
+ QuicTime when_lost = it->sent_time.Add(loss_delay);
if (time < when_lost) {
loss_detection_timeout_ = when_lost;
break;
}
- lost_packets.insert(it->first);
+ lost_packets.insert(sequence_number);
}
return lost_packets;
« no previous file with comments | « net/quic/congestion_control/tcp_loss_algorithm.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698