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

Issue 1320633002: Optimize for TouchStart responsiveness (Closed)

Created:
5 years, 3 months ago by alex clarke (OOO till 29th)
Modified:
5 years, 3 months ago
CC:
cc-bugs_chromium.org, chromium-reviews, scheduler-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Optimize for TouchStart responsiveness by modeling what the user is doing. We have come to realize that TouchStart responsiveness is really critical for a good user experience. This patch introduces a (initially very simple) system for modeling what the user is doing and predicting when they are likely to initiate a new gesture (taps are ignored). We order task priority accordingly. In addition we extend the estimation of task cost to loading tasks which are often a significant source of jank. Load tasks can be very long (easily up to 1000ms). There is no good way to cooperatively schedule such a task but the least worst user experience seems to be if we get them out of the way as fast as possible. Ideally we'd prioritize them but the order of IPC and LoadingTasks currently needs to be more or less in lockstep. Instead we deprioritize compositor tasks inside a compositor gesture, which has the effect of prioritizing other work. Expected changes on Perf bots: 1. first_gesture_scroll_update_latency in smoothness.scrolling_tough_ad_cases should go down. This should be highly user visible. 2. It's possible some compositor metrics such as queueing_durations may regress. I don't expect this to be user visible. BUG=510398 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/464b1a5144ddb5135dad845aceb5b1f074221387 Cr-Commit-Position: refs/heads/master@{#347937}

Patch Set 1 #

Patch Set 2 : Rebase + remove some unwanted changes #

Total comments: 42

Patch Set 3 : Introduced a UserModel class #

Total comments: 17

Patch Set 4 : Fix moFix most of Sami's concerns #

Patch Set 5 : Fix dodgy merge #

Patch Set 6 : Responding to feedback #

Patch Set 7 : Rebase plus fix destructor bug #

Patch Set 8 : Fix small bug in UpdateForInputEventOnCompositorThread #

Total comments: 10

Patch Set 9 : Rebased + changes for Sami #

Total comments: 2

Patch Set 10 : No longer prioritizing loading tasks by default. #

Patch Set 11 : Fix a test #

Patch Set 12 : Fix unit tests and prioritize default tasks when loading tasks are priotized. #

Total comments: 4

Patch Set 13 : NONE prioritization is gone #

Total comments: 2

Patch Set 14 : Fix bug with default TQ not being checked when comparing policies #

Patch Set 15 : Deprioritize compositor tasks during the first part of UseCase::COMPOSITOR_GESTURE #

Patch Set 16 : Reset cost estimation on navigation comit #

Patch Set 17 : Remove code to surpress blocking of expensive tasks in the 1st sec, the reset should suffice. #

Patch Set 18 : Handle taps differently from scrolls in the UserModel #

Patch Set 19 : TEST #

Patch Set 20 : TEST2 #

Patch Set 21 : TEST£ #

Patch Set 22 : Try set OnPageLoadStarted in RenderFrameImpl::OnNavigate #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1235 lines, -419 lines) Patch
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M components/scheduler/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/scheduler/renderer/renderer_scheduler.h View 1 2 3 4 5 6 7 8 2 chunks +15 lines, -0 lines 0 comments Download
M components/scheduler/renderer/renderer_scheduler.cc View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
M components/scheduler/renderer/renderer_scheduler_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +60 lines, -53 lines 0 comments Download
M components/scheduler/renderer/renderer_scheduler_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 21 chunks +307 lines, -239 lines 0 comments Download
M components/scheduler/renderer/renderer_scheduler_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 34 chunks +311 lines, -125 lines 0 comments Download
M components/scheduler/renderer/task_cost_estimator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M components/scheduler/renderer/task_cost_estimator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +5 lines, -0 lines 0 comments Download
M components/scheduler/renderer/task_cost_estimator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +15 lines, -2 lines 0 comments Download
A components/scheduler/renderer/user_model.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +69 lines, -0 lines 0 comments Download
A components/scheduler/renderer/user_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +110 lines, -0 lines 0 comments Download
A components/scheduler/renderer/user_model_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +298 lines, -0 lines 0 comments Download
M components/scheduler/scheduler.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 88 (36 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/1
5 years, 3 months ago (2015-08-26 10:44:16 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/61548) ios_rel_device_ninja on ...
5 years, 3 months ago (2015-08-26 10:45:32 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/20001
5 years, 3 months ago (2015-08-26 11:07:25 UTC) #6
alex clarke (OOO till 29th)
5 years, 3 months ago (2015-08-26 11:08:09 UTC) #8
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/103708)
5 years, 3 months ago (2015-08-26 12:03:11 UTC) #10
Sami
The new use case based approach looks awesome. https://codereview.chromium.org/1320633002/diff/20001/cc/trees/thread_proxy.cc File cc/trees/thread_proxy.cc (right): https://codereview.chromium.org/1320633002/diff/20001/cc/trees/thread_proxy.cc#newcode1183 cc/trees/thread_proxy.cc:1183: // ...
5 years, 3 months ago (2015-08-26 13:38:02 UTC) #11
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/1320633002/diff/20001/cc/trees/thread_proxy.cc File cc/trees/thread_proxy.cc (right): https://codereview.chromium.org/1320633002/diff/20001/cc/trees/thread_proxy.cc#newcode1183 cc/trees/thread_proxy.cc:1183: // Put the scheduler in impl latency prioritization ...
5 years, 3 months ago (2015-08-27 12:02:51 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/40001
5 years, 3 months ago (2015-08-27 12:03:21 UTC) #14
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/96515)
5 years, 3 months ago (2015-08-27 12:44:27 UTC) #16
Sami
https://codereview.chromium.org/1320633002/diff/20001/components/scheduler/renderer/renderer_scheduler_impl.cc File components/scheduler/renderer/renderer_scheduler_impl.cc (right): https://codereview.chromium.org/1320633002/diff/20001/components/scheduler/renderer/renderer_scheduler_impl.cc#newcode587 components/scheduler/renderer/renderer_scheduler_impl.cc:587: new_policy.timer_queue_priority_ = TaskQueue::DISABLED_PRIORITY; On 2015/08/27 12:02:51, alexclarke1 wrote: > ...
5 years, 3 months ago (2015-08-27 15:15:59 UTC) #17
Sami
Also re: the title, this isn't really a refactor since it's changing the scheduling policy ...
5 years, 3 months ago (2015-08-27 15:20:26 UTC) #18
alex clarke (OOO till 29th)
PTAL. As discussed off line I changed UserModel to have no references to threading. Also ...
5 years, 3 months ago (2015-09-03 10:34:25 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/120001
5 years, 3 months ago (2015-09-04 08:49:09 UTC) #21
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/140001
5 years, 3 months ago (2015-09-04 09:36:22 UTC) #23
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/103291) win_chromium_x64_rel_ng on ...
5 years, 3 months ago (2015-09-04 10:18:27 UTC) #25
Sami
Looks great overall. Just a few suggestions for the UserModel class. https://codereview.chromium.org/1320633002/diff/140001/components/scheduler/renderer/renderer_scheduler_impl.cc File components/scheduler/renderer/renderer_scheduler_impl.cc (right): ...
5 years, 3 months ago (2015-09-04 10:58:21 UTC) #26
alex clarke (OOO till 29th)
https://codereview.chromium.org/1320633002/diff/140001/components/scheduler/renderer/renderer_scheduler_impl.cc File components/scheduler/renderer/renderer_scheduler_impl.cc (right): https://codereview.chromium.org/1320633002/diff/140001/components/scheduler/renderer/renderer_scheduler_impl.cc#newcode384 components/scheduler/renderer/renderer_scheduler_impl.cc:384: // The touchstart and main-thread scrolling states indicate a ...
5 years, 3 months ago (2015-09-07 11:09:28 UTC) #27
Sami
Thanks, lgtm! https://codereview.chromium.org/1320633002/diff/160001/components/scheduler/renderer/renderer_scheduler_impl.h File components/scheduler/renderer/renderer_scheduler_impl.h (right): https://codereview.chromium.org/1320633002/diff/160001/components/scheduler/renderer/renderer_scheduler_impl.h#newcode171 components/scheduler/renderer/renderer_scheduler_impl.h:171: base::TimeDelta TimeLeftInUserGesture(base::TimeTicks now) const; This method and ...
5 years, 3 months ago (2015-09-07 11:37:23 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/180001
5 years, 3 months ago (2015-09-07 11:51:18 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/100143) mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, ...
5 years, 3 months ago (2015-09-07 12:24:25 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/200001
5 years, 3 months ago (2015-09-07 12:39:04 UTC) #36
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/65846)
5 years, 3 months ago (2015-09-07 13:24:29 UTC) #38
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/220001
5 years, 3 months ago (2015-09-07 16:33:00 UTC) #40
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/1320633002/diff/160001/components/scheduler/renderer/renderer_scheduler_impl.h File components/scheduler/renderer/renderer_scheduler_impl.h (right): https://codereview.chromium.org/1320633002/diff/160001/components/scheduler/renderer/renderer_scheduler_impl.h#newcode171 components/scheduler/renderer/renderer_scheduler_impl.h:171: base::TimeDelta TimeLeftInUserGesture(base::TimeTicks now) const; On 2015/09/07 11:37:23, Sami ...
5 years, 3 months ago (2015-09-07 16:33:01 UTC) #41
Sami
Let's split the NONE prioritization tweak to a different patch like we talked about. https://codereview.chromium.org/1320633002/diff/220001/components/scheduler/renderer/renderer_scheduler_impl.cc ...
5 years, 3 months ago (2015-09-07 16:40:50 UTC) #42
alex clarke (OOO till 29th)
5 years, 3 months ago (2015-09-07 16:51:30 UTC) #43
Sami
Thanks, lgtm. https://codereview.chromium.org/1320633002/diff/220001/components/scheduler/renderer/renderer_scheduler_impl_unittest.cc File components/scheduler/renderer/renderer_scheduler_impl_unittest.cc (right): https://codereview.chromium.org/1320633002/diff/220001/components/scheduler/renderer/renderer_scheduler_impl_unittest.cc#newcode1009 components/scheduler/renderer/renderer_scheduler_impl_unittest.cc:1009: testing::ElementsAre(std::string("D1"), std::string("D2"), This should change back now ...
5 years, 3 months ago (2015-09-07 16:57:57 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/250001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/250001
5 years, 3 months ago (2015-09-07 17:14:28 UTC) #47
alex clarke (OOO till 29th)
https://codereview.chromium.org/1320633002/diff/220001/components/scheduler/renderer/renderer_scheduler_impl_unittest.cc File components/scheduler/renderer/renderer_scheduler_impl_unittest.cc (right): https://codereview.chromium.org/1320633002/diff/220001/components/scheduler/renderer/renderer_scheduler_impl_unittest.cc#newcode1009 components/scheduler/renderer/renderer_scheduler_impl_unittest.cc:1009: testing::ElementsAre(std::string("D1"), std::string("D2"), On 2015/09/07 16:57:57, Sami wrote: > This ...
5 years, 3 months ago (2015-09-07 17:14:29 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/270001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/270001
5 years, 3 months ago (2015-09-07 17:29:23 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/100984)
5 years, 3 months ago (2015-09-07 18:28:47 UTC) #54
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/290001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/290001
5 years, 3 months ago (2015-09-08 13:46:32 UTC) #56
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-08 15:06:10 UTC) #58
alex clarke (OOO till 29th)
Sami please take one (hopefully) final look! This now passes the CQ.
5 years, 3 months ago (2015-09-08 15:09:13 UTC) #59
alex clarke (OOO till 29th)
Sami please take one (hopefully) final look! This now passes the CQ.
5 years, 3 months ago (2015-09-08 15:09:16 UTC) #60
alex clarke (OOO till 29th)
jochen@chromium.org: Please review changes in content/renderer/render_frame_impl.cc
5 years, 3 months ago (2015-09-08 15:13:27 UTC) #62
jochen (gone - plz use gerrit)
lgtm
5 years, 3 months ago (2015-09-08 15:14:15 UTC) #63
Sami
Thanks for sorting out the failures, lgtm to land. I'm a tiny bit worried about ...
5 years, 3 months ago (2015-09-08 15:26:37 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/310001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/310001
5 years, 3 months ago (2015-09-08 15:31:48 UTC) #67
alex clarke (OOO till 29th)
The diff base for renderer_scheduler_impl.cc is slightly weird due to a non-trivial rebase. This wil ...
5 years, 3 months ago (2015-09-08 16:31:42 UTC) #68
alex clarke (OOO till 29th)
On 2015/09/08 16:31:42, alexclarke1 wrote: > The diff base for renderer_scheduler_impl.cc is slightly weird due ...
5 years, 3 months ago (2015-09-08 16:33:05 UTC) #69
alex clarke (OOO till 29th)
On 2015/09/08 16:31:42, alexclarke1 wrote: > The diff base for renderer_scheduler_impl.cc is slightly weird due ...
5 years, 3 months ago (2015-09-08 16:33:07 UTC) #70
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/76734)
5 years, 3 months ago (2015-09-08 17:01:37 UTC) #72
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/330001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/330001
5 years, 3 months ago (2015-09-09 10:12:34 UTC) #74
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/410001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/410001
5 years, 3 months ago (2015-09-09 14:02:08 UTC) #76
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_chromium_compile_only_ng/builds/30163)
5 years, 3 months ago (2015-09-09 14:27:07 UTC) #78
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/410001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/410001
5 years, 3 months ago (2015-09-09 14:46:29 UTC) #80
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-09 15:35:43 UTC) #82
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320633002/410001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320633002/410001
5 years, 3 months ago (2015-09-09 15:36:58 UTC) #85
commit-bot: I haz the power
Committed patchset #22 (id:410001)
5 years, 3 months ago (2015-09-09 15:42:49 UTC) #86
commit-bot: I haz the power
Patchset 22 (id:??) landed as https://crrev.com/464b1a5144ddb5135dad845aceb5b1f074221387 Cr-Commit-Position: refs/heads/master@{#347937}
5 years, 3 months ago (2015-09-09 15:43:41 UTC) #87
jam
5 years, 3 months ago (2015-09-11 18:25:33 UTC) #88
Message was sent while issue was closed.
A revert of this CL (patchset #22 id:410001) has been created in
https://codereview.chromium.org/1337993002/ by jam@chromium.org.

The reason for reverting is: adds flaky test, causes other test to be flaky

BUG=530250.

Powered by Google App Engine
This is Rietveld 408576698