scheduler: Disable expensive timers during main thread user input
commite8b4542c35200e17ea6cadfb1d3f0cab13a563bc
authorskyostil <skyostil@chromium.org>
Fri, 21 Aug 2015 21:04:41 +0000 (21 14:04 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 21 Aug 2015 21:05:28 +0000 (21 21:05 +0000)
tree3b0a4e343bd73da694bc3c05a4fd7109d5720002
parent7b4c899b756fdbeba3fb9413a088b3372374b11c
scheduler: Disable expensive timers during main thread user input

Previously, if the user was interacting with the device, we
would only allow timers to run during idle periods. Turns
out this strategy wasn't effective with workloads with very
expensive timers. This is because even the occasional idle
period is enough to let a long running timer execute,
potentially causing jank.

This patch changes the heuristic to be based on the
expected run time of each timer task. The estimation is
based on historical run times. If we have seen user input
recently and the main thread is on the critical path, we
now disable timer tasks completely for the duration of the
interaction.

As a follow up we may want to consider doing similar
estimation for loading tasks, as well as estimating
workloads from different domains separately.

BUG=523406

Review URL: https://codereview.chromium.org/1303353003

Cr-Commit-Position: refs/heads/master@{#344858}
15 files changed:
components/components_tests.gyp
components/scheduler/BUILD.gn
components/scheduler/child/task_queue.h
components/scheduler/child/task_queue_impl.cc
components/scheduler/child/task_queue_impl.h
components/scheduler/child/task_queue_manager.cc
components/scheduler/child/task_queue_manager_unittest.cc
components/scheduler/renderer/DEPS
components/scheduler/renderer/renderer_scheduler_impl.cc
components/scheduler/renderer/renderer_scheduler_impl.h
components/scheduler/renderer/renderer_scheduler_impl_unittest.cc
components/scheduler/renderer/task_cost_estimator.cc [new file with mode: 0644]
components/scheduler/renderer/task_cost_estimator.h [new file with mode: 0644]
components/scheduler/renderer/task_cost_estimator_unittest.cc [new file with mode: 0644]
components/scheduler/scheduler.gypi