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

Unified Diff: net/quic/quic_received_packet_manager.h

Issue 496133002: Optimize QUIC's EntropyTracker in QuicReceivedPacketManager by using a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enable_pacing_via_config_73685838
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 | « no previous file | net/quic/quic_received_packet_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_received_packet_manager.h
diff --git a/net/quic/quic_received_packet_manager.h b/net/quic/quic_received_packet_manager.h
index 43f6b5583f9057252bb4d68e20dc8a7db80d3065..92c08f55c14113d182e388df2a352fc1e3e90156 100644
--- a/net/quic/quic_received_packet_manager.h
+++ b/net/quic/quic_received_packet_manager.h
@@ -8,6 +8,8 @@
#ifndef NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_
#define NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_
+#include <deque>
+
#include "net/quic/congestion_control/receive_algorithm_interface.h"
#include "net/quic/quic_framer.h"
#include "net/quic/quic_protocol.h"
@@ -59,22 +61,20 @@ class NET_EXPORT_PRIVATE QuicReceivedPacketManager :
private:
friend class test::EntropyTrackerPeer;
- typedef std::map<QuicPacketSequenceNumber,
- QuicPacketEntropyHash> ReceivedEntropyMap;
+ // A deque indexed by sequence number storing the packet's hash and whether
+ // a hash was recorded for that sequence number.
+ typedef std::deque<std::pair<QuicPacketEntropyHash, bool>>
+ ReceivedEntropyHashes;
// Recomputes first_gap_ and removes packets_entropy_ entries that are no
// longer needed to compute EntropyHash.
void AdvanceFirstGapAndGarbageCollectEntropyMap();
- // TODO(satyamshekhar): Can be optimized using an interval set like data
- // structure.
// Map of received sequence numbers to their corresponding entropy.
// Stores an entry for every received packet whose sequence_number is larger
// than first_gap_. Packets without the entropy bit set have an entropy
// value of 0.
- // TODO(ianswett): When the entropy flag is off, the entropy
- // should not be 0.
- ReceivedEntropyMap packets_entropy_;
+ ReceivedEntropyHashes packets_entropy_;
// Cumulative hash of entropy of all received packets.
QuicPacketEntropyHash packets_entropy_hash_;
@@ -135,9 +135,6 @@ class NET_EXPORT_PRIVATE QuicReceivedPacketManager :
void UpdatePacketInformationSentByPeer(
const QuicStopWaitingFrame& stop_waiting);
- // Returns whether the peer is missing packets.
- bool HasMissingPackets();
-
// Returns true when there are new missing packets to be reported within 3
// packets of the largest observed.
bool HasNewMissingPackets();
« no previous file with comments | « no previous file | net/quic/quic_received_packet_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698