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

Issue 2663383004: Avoid calling PostTask in audio callbacks (Closed)

Created:
3 years, 10 months ago by henrika_webrtc
Modified:
3 years, 10 months ago
Reviewers:
the sun
CC:
webrtc-reviews_webrtc.org
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Avoid calling PostTask in audio callbacks. We have seen that PostTask can consume some CPU and the way we used it before (logging only) in the ADB is not worth the cost we see when profiling. This CL simply moves frequent (trivial) stat updates from the task queue to the native threads to avoid calling PostTask in each callback. The reason for doing so before was to avoid locks but we can live without them since races are benign here. BUG=webrtc:7096 Review-Url: https://codereview.webrtc.org/2663383004 Cr-Commit-Position: refs/heads/master@{#16429} Committed: https://chromium.googlesource.com/external/webrtc/+/77ce9a55415a673422d424ed862be142d5e277ef

Patch Set 1 #

Patch Set 2 : nits #

Patch Set 3 : Now uses locks instead #

Patch Set 4 : nit #

Total comments: 4

Patch Set 5 : Improved locking scheme #

Total comments: 4

Patch Set 6 : Final changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -100 lines) Patch
M webrtc/modules/audio_device/audio_device_buffer.h View 1 2 3 4 5 6 chunks +49 lines, -38 lines 0 comments Download
M webrtc/modules/audio_device/audio_device_buffer.cc View 1 2 3 4 5 5 chunks +41 lines, -62 lines 0 comments Download

Messages

Total messages: 38 (26 generated)
henrika_webrtc
Taking one step back. PTAL
3 years, 10 months ago (2017-02-01 12:15:19 UTC) #3
the sun
On 2017/02/01 12:15:19, henrika_webrtc wrote: > Taking one step back. > > PTAL "races are ...
3 years, 10 months ago (2017-02-01 13:12:39 UTC) #9
henrika_webrtc
Point taken. It did not feel OK to write those lines. We only read once ...
3 years, 10 months ago (2017-02-01 13:20:06 UTC) #10
henrika_webrtc
PTAL
3 years, 10 months ago (2017-02-01 14:19:28 UTC) #11
the sun
https://codereview.webrtc.org/2663383004/diff/60001/webrtc/modules/audio_device/audio_device_buffer.cc File webrtc/modules/audio_device/audio_device_buffer.cc (right): https://codereview.webrtc.org/2663383004/diff/60001/webrtc/modules/audio_device/audio_device_buffer.cc#newcode449 webrtc/modules/audio_device/audio_device_buffer.cc:449: rtc::CritScope cs(&lock_); It bothers me that you're holding the ...
3 years, 10 months ago (2017-02-01 22:37:42 UTC) #20
henrika_webrtc
Thanks. PTAL. https://codereview.webrtc.org/2663383004/diff/60001/webrtc/modules/audio_device/audio_device_buffer.cc File webrtc/modules/audio_device/audio_device_buffer.cc (right): https://codereview.webrtc.org/2663383004/diff/60001/webrtc/modules/audio_device/audio_device_buffer.cc#newcode449 webrtc/modules/audio_device/audio_device_buffer.cc:449: rtc::CritScope cs(&lock_); Will do. Thanks. https://codereview.webrtc.org/2663383004/diff/60001/webrtc/modules/audio_device/audio_device_buffer.h File ...
3 years, 10 months ago (2017-02-02 13:51:49 UTC) #21
the sun
almost! https://codereview.webrtc.org/2663383004/diff/80001/webrtc/modules/audio_device/audio_device_buffer.cc File webrtc/modules/audio_device/audio_device_buffer.cc (right): https://codereview.webrtc.org/2663383004/diff/80001/webrtc/modules/audio_device/audio_device_buffer.cc#newcode465 webrtc/modules/audio_device/audio_device_buffer.cc:465: rtc::CritScope cs(&lock_); No need to take the lock ...
3 years, 10 months ago (2017-02-02 19:38:38 UTC) #26
henrika_webrtc
Done. PTAL ;-) https://codereview.webrtc.org/2663383004/diff/80001/webrtc/modules/audio_device/audio_device_buffer.cc File webrtc/modules/audio_device/audio_device_buffer.cc (right): https://codereview.webrtc.org/2663383004/diff/80001/webrtc/modules/audio_device/audio_device_buffer.cc#newcode465 webrtc/modules/audio_device/audio_device_buffer.cc:465: rtc::CritScope cs(&lock_); Better than mine. Thanks! ...
3 years, 10 months ago (2017-02-03 09:00:54 UTC) #27
the sun
nice, LGTM
3 years, 10 months ago (2017-02-03 10:14:38 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2663383004/100001
3 years, 10 months ago (2017-02-03 10:16:42 UTC) #34
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/external/webrtc/+/77ce9a55415a673422d424ed862be142d5e277ef
3 years, 10 months ago (2017-02-03 10:19:22 UTC) #37
henrika_webrtc
3 years, 10 months ago (2017-02-08 12:30:29 UTC) #38
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:100001) has been created in
https://codereview.webrtc.org/2684913003/ by henrika@webrtc.org.

The reason for reverting is: Speculative revert to see if this CL caused a
change in performance tests.

See https://bugs.chromium.org/p/chromium/issues/detail?id=689919 for details..

Powered by Google App Engine
This is Rietveld 408576698