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

Issue 2709813003: [Mac] Reduce timer CPU use in MessagePumpCFRunLoopBase. (Closed)

Created:
3 years, 10 months ago by shrike
Modified:
3 years, 10 months ago
CC:
chromium-reviews, mac-reviews_chromium.org, sadrul, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Mac] Reduce timer CPU use in MessagePumpCFRunLoopBase. MessagePumpCFRunLoopBase's approach to timers, as recommended by Apple, leads to two timer reschedulings per timer firing. Timer reschedulings are quite expensive, and the extra rescheduling can cause Chrome to consume up to 2x the CPU of Safari on the same page. This change uses private (but not secret) API to temporarily invalidate a MessagePumpCFRunLoopBase's CFRunLoopTimer, causing the run loop to bypass the extra rescheduling. R=mark@chromium.org, rsesek@chromium.org BUG=511406 Review-Url: https://codereview.chromium.org/2709813003 Cr-Commit-Position: refs/heads/master@{#452852} Committed: https://chromium.googlesource.com/chromium/src/+/3a16446d4864b4ad7159df1534357c9cc8ab21d7

Patch Set 1 #

Total comments: 18

Patch Set 2 : Address feedback, checkpoint. #

Patch Set 3 : Finish tests. #

Patch Set 4 : Add to tests. #

Patch Set 5 : Restore comment, fix typos. #

Patch Set 6 : Fix iOS compile problems. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+245 lines, -1 line) Patch
M base/BUILD.gn View 5 1 chunk +1 line, -0 lines 0 comments Download
M base/message_loop/message_pump_mac.h View 1 2 2 chunks +18 lines, -1 line 0 comments Download
M base/message_loop/message_pump_mac.mm View 1 2 3 4 5 4 chunks +118 lines, -0 lines 0 comments Download
A base/message_loop/message_pump_mac_unittest.cc View 1 2 3 1 chunk +108 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (11 generated)
shrike
I found a simpler way to prevent the extra timer reschedulings that consume extra CPU ...
3 years, 10 months ago (2017-02-21 15:25:48 UTC) #1
Mark Mentovai
https://codereview.chromium.org/2709813003/diff/1/base/BUILD.gn File base/BUILD.gn (right): https://codereview.chromium.org/2709813003/diff/1/base/BUILD.gn#newcode1 base/BUILD.gn:1: # Copyright (c) 2013 The Chromium Authors. All rights ...
3 years, 10 months ago (2017-02-21 17:41:23 UTC) #2
Mark Mentovai
https://codereview.chromium.org/2709813003/diff/1/base/message_loop/message_pump_mac.mm File base/message_loop/message_pump_mac.mm (right): https://codereview.chromium.org/2709813003/diff/1/base/message_loop/message_pump_mac.mm#newcode113 base/message_loop/message_pump_mac.mm:113: // 2008 in CF-476). Call out 10.5 by name ...
3 years, 10 months ago (2017-02-21 18:10:57 UTC) #5
shrike
PTAL https://codereview.chromium.org/2709813003/diff/1/base/BUILD.gn File base/BUILD.gn (right): https://codereview.chromium.org/2709813003/diff/1/base/BUILD.gn#newcode1 base/BUILD.gn:1: # Copyright (c) 2013 The Chromium Authors. All ...
3 years, 10 months ago (2017-02-22 00:57:53 UTC) #6
Mark Mentovai
LGTM https://codereview.chromium.org/2709813003/diff/1/base/message_loop/message_pump_mac.mm File base/message_loop/message_pump_mac.mm (right): https://codereview.chromium.org/2709813003/diff/1/base/message_loop/message_pump_mac.mm#newcode113 base/message_loop/message_pump_mac.mm:113: // 2008 in CF-476). On 2017/02/22 00:57:52, shrike ...
3 years, 10 months ago (2017-02-23 02:34:37 UTC) #7
shrike
https://codereview.chromium.org/2709813003/diff/1/base/message_loop/message_pump_mac.mm File base/message_loop/message_pump_mac.mm (right): https://codereview.chromium.org/2709813003/diff/1/base/message_loop/message_pump_mac.mm#newcode113 base/message_loop/message_pump_mac.mm:113: // 2008 in CF-476). On 2017/02/23 02:34:36, Mark Mentovai ...
3 years, 10 months ago (2017-02-23 17:51:11 UTC) #8
Robert Sesek
LGTM On 2017/02/23 17:51:11, shrike wrote: > What is your sense of the risk with ...
3 years, 10 months ago (2017-02-23 18:06:05 UTC) #9
Mark Mentovai
I’m also not worried about the risk. We know what all of the shipping OSes ...
3 years, 10 months ago (2017-02-23 18:25:25 UTC) #10
shrike
On 2017/02/23 18:25:25, Mark Mentovai wrote: > I’m also not worried about the risk. We ...
3 years, 10 months ago (2017-02-23 18:34:48 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2709813003/80001
3 years, 10 months ago (2017-02-23 18:35:23 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/159010) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 10 months ago (2017-02-23 18:46:37 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2709813003/100001
3 years, 10 months ago (2017-02-23 22:06:27 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_tsan_rel_ng/builds/21132)
3 years, 10 months ago (2017-02-24 00:16:35 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2709813003/100001
3 years, 10 months ago (2017-02-24 17:00:24 UTC) #23
commit-bot: I haz the power
3 years, 10 months ago (2017-02-24 17:06:02 UTC) #26
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/3a16446d4864b4ad7159df153435...

Powered by Google App Engine
This is Rietveld 408576698