Commit graph

7 commits

Author SHA1 Message Date
Danil Chapovalov
17f783eee8 Skip trimming packet arrival history at the beginning
PacketArrivalMap explicitly doesn't promise packet at the beginning
of it is received. Ensuring that property is wasteful

Bug: chromium:1382563
Change-Id: Ifc898b7ec2bc7a302af8dcfd233e0c598f62db95
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290501
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39083}
2023-01-12 11:59:27 +00:00
Johannes Kron
c5aac4ec1f Fix crash in PacketArrivalMap::EraseTo() when using missing seq number
There was a DCHECK in PacketArrivalMap::EraseTo() that the
seqeuence number that is used as argument has been received.
However, this is not necessarily the case since it's cleared upon
a request of a feedback report from the sender.

Bug: webrtc:14679
Change-Id: I908b4bf1f2a4355593f0a361e1733fc91527366d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283741
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38755}
2022-11-29 12:29:43 +00:00
Danil Chapovalov
ea59abe44e Speed up congestion controller feedback fuzzer
When packet arrives with large gap majority of the time could be spend
in finding next received packet. Embedding such search into PacketArrivalMap
makes it faster

Bug: chromium:1373414
Change-Id: I2e0be0f2fc4ea96af081531d575a17c70b72b25b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279881
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38459}
2022-10-24 13:43:16 +00:00
Danil Chapovalov
7f0a7acb0a Improve PacketArrivalTimeMap perfomance
replace std::deque implementation with a manually controlled circular buffer.
replace Timestamp validity check from 'IsInfinite()' accesser to cheaper comparison to zero.
These greatly increase PacketArrivalTimeMap::AddPacket perfomance when packet arrive with large sequence number gaps.

Bug: chromium:1349880
Change-Id: I6f4e814b1086ca9d0b48608531e3a387d9e542dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270564
Reviewed-by: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37722}
2022-08-09 13:31:20 +00:00
Danil Chapovalov
fc22dfa727 In RemoteEstimatorProxy treat zero arrival time as valid
Inserting packet with zero arrival time may trigger inconsistent state in the internal map where packet sometimes treated as received, but sometimes treated as not received.

Bug: chromium:1346959
Change-Id: I0809e41a873103dcd62528358e64794c1d3cb28f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269382
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37609}
2022-07-25 13:08:19 +00:00
Danil Chapovalov
1220855430 In RemoteEstimatorProxy use Timestamp type
to assemble rtcp::TransportFeedback

Bug: webrtc:13757
Change-Id: I668d9e61d82b454a6884eff223804afc882d86a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264900
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37192}
2022-06-13 10:07:46 +00:00
Victor Boivie
ae1f8f59ac Use a std::deque in RemoteEstimatorProxy
Before this CL, the RemoteEstimatorProxy used a std::map to track which
arrival time a packet with a certain sequence number was received at.
While this works, it's fairly slow as most manipulations and insertions
are O(log(N)) and there were quite many of them.

By taking advantage that sequence numbers generally are received in
sequence, recording a packet is now amortized O(1). Also other
operations such as creating the periodic feedback reports, are also
much faster as it previously was done by searching quite a few times
in that map.

In highly loaded Media Servers, RemoteEstimatorProxy's usage of
std::map attributes to around 0.52% CPU.

Bug: webrtc:12689
Change-Id: I3dd58105f9fbfb111f176833cd4aa6b040c0e01d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217388
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33979}
2021-05-11 10:19:06 +00:00