|
|
Chromium Code Reviews|
Created:
3 years, 11 months ago by elad.alon Modified:
3 years, 11 months ago CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, zhuangzesen_agora.io, danilchap, mflodman Target Ref:
refs/heads/master Project:
webrtc Visibility:
Public. |
DescriptionAvoid multiple calls to webrtc::field_trial::FindFullName in RTPSender; it's inefficient to perform string comparison whenever we send a packet.
BUG=None
Review-Url: https://codereview.webrtc.org/2637203002
Cr-Commit-Position: refs/heads/master@{#16291}
Committed: https://chromium.googlesource.com/external/webrtc/+/c3dfff3126e4756c573cc1bdb95b28c57d1a66d7
Patch Set 1 #
Total comments: 2
Patch Set 2 : Rebased #Patch Set 3 : Trying again... #
Messages
Total messages: 43 (17 generated)
Description was changed from ========== Avoid multiple calls to webrtc::field_trial::FindFullName in RTPSender ========== to ========== Avoid multiple calls to webrtc::field_trial::FindFullName in RTPSender; it's inefficient to perform string comparison whenever we send a packet. ==========
elad.alon@webrtc.org changed reviewers: + michaelt@webrtc.org, minyue@webrtc.org, solenberg@webrtc.org, sprang@webrtc.org, stefan@webrtc.org
Could anyone give the way to edit the source behind FindFullName, so that I'll make sure it is populated before the RTPSender ctor is called?
On 2017/01/17 19:17:21, elad.alon wrote: > Could anyone give the way to edit the source behind FindFullName, so that I'll > make sure it is populated before the RTPSender ctor is called? I see it's done from main() in the demo app. Is this the case for all relevant applications?
https://codereview.webrtc.org/2637203002/diff/1/webrtc/modules/rtp_rtcp/sourc... File webrtc/modules/rtp_rtcp/source/rtp_sender.cc (left): https://codereview.webrtc.org/2637203002/diff/1/webrtc/modules/rtp_rtcp/sourc... webrtc/modules/rtp_rtcp/source/rtp_sender.cc:1259: if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe-WithOverhead") == but it is called only once, isn't it?
On 2017/01/17 19:29:12, elad.alon wrote: > On 2017/01/17 19:17:21, elad.alon wrote: > > Could anyone give the way to edit the source behind FindFullName, so that I'll > > make sure it is populated before the RTPSender ctor is called? > > I see it's done from main() in the demo app. Is this the case for all relevant > applications? Field trial is meant to be set up on the app level.
I believe this should be safe. Field trials should be set on the PeerConnectionFactory before any PeerConnection has been created. https://codereview.webrtc.org/2637203002/diff/1/webrtc/modules/rtp_rtcp/sourc... File webrtc/modules/rtp_rtcp/source/rtp_sender.cc (left): https://codereview.webrtc.org/2637203002/diff/1/webrtc/modules/rtp_rtcp/sourc... webrtc/modules/rtp_rtcp/source/rtp_sender.cc:1259: if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe-WithOverhead") == On 2017/01/18 08:14:38, minyue-webrtc(OOOtoJan17) wrote: > but it is called only once, isn't it? Once for every packet sent. Still a lot... :)
lgtm
On 2017/01/18 08:41:40, stefan-webrtc wrote: > I believe this should be safe. Field trials should be set on the > PeerConnectionFactory before any PeerConnection has been created. > > https://codereview.webrtc.org/2637203002/diff/1/webrtc/modules/rtp_rtcp/sourc... > File webrtc/modules/rtp_rtcp/source/rtp_sender.cc (left): > > https://codereview.webrtc.org/2637203002/diff/1/webrtc/modules/rtp_rtcp/sourc... > webrtc/modules/rtp_rtcp/source/rtp_sender.cc:1259: if > (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe-WithOverhead") == > On 2017/01/18 08:14:38, minyue-webrtc(OOOtoJan17) wrote: > > but it is called only once, isn't it? > > Once for every packet sent. Still a lot... :) OK!
lgtm
looks ok. As far that i know we have the same issue in transport feedback adaptor. When we add the transport overhead. Should we do the same trick there as well?
On 2017/01/18 09:45:48, michaelt wrote: > looks ok. As far that i know we have the same issue in transport feedback > adaptor. When we add the transport overhead. Should we do the same trick there > as well? Yes, that would be good. Can you take a look?
On 2017/01/18 09:48:24, stefan-webrtc wrote: > On 2017/01/18 09:45:48, michaelt wrote: > > looks ok. As far that i know we have the same issue in transport feedback > > adaptor. When we add the transport overhead. Should we do the same trick there > > as well? > > Yes, that would be good. Can you take a look? Sure. I was thinking of adding a little mechanism to make sure that the function is not called more than X times with the same string - this validation to only be used in debug - to catch other instances of this problem. Do you guys think it would be useful?
i don't know if this a good idea. i guess we would run in to troubles in the unit test. And it will hard to say how may calls will be too much. Since the checks can be spread over the code like in "bwe with overhead"
On 2017/01/18 10:13:33, michaelt wrote: > i don't know if this a good idea. i guess we would run in to troubles in the > unit test. And it will hard to say how may calls will be too much. Since the > checks can be spread over the code like in "bwe with overhead" My idea is to RTC_DCHECK(not_too_many_calls(str)), where not_too_many_calls() is a function that writes to a local std::map<std::string, size_t>. In debug builds, this would make sure it's not called too often. In release, it will have no effect, and so incur no performance penalty. We can get around it triggering in UT by either of the following: * Setting the threshold for too many calls differently for different applications. * Setting the threshold high enough that it won't be triggered by UT, but would be triggered by applications (every single RTP packet > UT tests). * Having UT reset the counters.
lgtm
On 2017/01/18 10:33:07, elad.alon wrote: > On 2017/01/18 10:13:33, michaelt wrote: > > i don't know if this a good idea. i guess we would run in to troubles in the > > unit test. And it will hard to say how may calls will be too much. Since the > > checks can be spread over the code like in "bwe with overhead" > > My idea is to RTC_DCHECK(not_too_many_calls(str)), where not_too_many_calls() is > a function that writes to a local std::map<std::string, size_t>. In debug > builds, this would make sure it's not called too often. In release, it will have > no effect, and so incur no performance penalty. > We can get around it triggering in UT by either of the following: > * Setting the threshold for too many calls differently for different > applications. > * Setting the threshold high enough that it won't be triggered by UT, but would > be triggered by applications (every single RTP packet > UT tests). > * Having UT reset the counters. For me it's good enough to just manually ensure we call it in the constructors. It should hopefully be gone in a not too distant future.
I'll land this and push the other fixes for a separate review, then.
The CQ bit was unchecked by elad.alon@webrtc.org
The CQ bit was checked by elad.alon@webrtc.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/12675)
The CQ bit was checked by elad.alon@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from sprang@webrtc.org, stefan@webrtc.org, minyue@webrtc.org Link to the patchset: https://codereview.webrtc.org/2637203002/#ps20001 (title: "Rebased")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/12677)
The CQ bit was checked by elad.alon@webrtc.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/12679)
The CQ bit was checked by elad.alon@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from sprang@webrtc.org, stefan@webrtc.org, minyue@webrtc.org Link to the patchset: https://codereview.webrtc.org/2637203002/#ps40001 (title: "Trying again...")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/12681)
Description was changed from ========== Avoid multiple calls to webrtc::field_trial::FindFullName in RTPSender; it's inefficient to perform string comparison whenever we send a packet. ========== to ========== Avoid multiple calls to webrtc::field_trial::FindFullName in RTPSender; it's inefficient to perform string comparison whenever we send a packet. BUG=None ==========
The CQ bit was checked by elad.alon@webrtc.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1485426675849060,
"parent_rev": "52cdd3bb305190d287db73ee29bc4370a5ce2788", "commit_rev":
"c3dfff3126e4756c573cc1bdb95b28c57d1a66d7"}
Message was sent while issue was closed.
Description was changed from ========== Avoid multiple calls to webrtc::field_trial::FindFullName in RTPSender; it's inefficient to perform string comparison whenever we send a packet. BUG=None ========== to ========== Avoid multiple calls to webrtc::field_trial::FindFullName in RTPSender; it's inefficient to perform string comparison whenever we send a packet. BUG=None Review-Url: https://codereview.webrtc.org/2637203002 Cr-Commit-Position: refs/heads/master@{#16291} Committed: https://chromium.googlesource.com/external/webrtc/+/c3dfff3126e4756c573cc1bdb... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/external/webrtc/+/c3dfff3126e4756c573cc1bdb... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
