-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save old TCC feedback timestamps, in case of packet reordering. #218
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
// Start new feedback packet, cull old packets. | ||
packetArrivalTimes.entries.removeIf { | ||
entry -> entry.key < tccSeqNum && | ||
timestamp - entry.value >= BACK_WINDOW_MS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit concerning because:
- The map will usually contain ~500ms worth of packets (~150-200 packets).
removeIf
is linearremoveIf
will execute once per sent TCC feedback
Are any of my premises wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think they are. I'll try profiling it and see what I find.
Chrome does the same thing (it uses an explicit for loop with an iterator rather than a lambda but the semantic is the same) but of course it's only sending one source, so presumably less media, and also the computational cost compared to a browser is relatively much less than an SFU.
In theory if we used an explicit loop we could terminate the search by entry.key
, but I'm pretty sure that in the normal cases this wouldn't be much of a win since tccSeqNum will be greater than any previous key anyway.
Based on libwebrtc's equivalent code (as used in Chrome).
8057c79
to
4c5056b
Compare
Since most of this PR ended up in #222, I've rebased this one to have just the remaining part. |
Based on libwebrtc's equivalent code (as used in Chrome) -- see https://webrtc.googlesource.com/src/+/refs/heads/master/modules/remote_bitrate_estimator/remote_estimator_proxy.cc .