diff options
author | ericrk <ericrk@chromium.org> | 2015-12-14 18:57:58 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-15 02:58:40 +0000 |
commit | 05ca4bc9df381e6345f9cf7ee29cdfa075be30c4 (patch) | |
tree | c17e17f624bc5691d5f3efe33c91f69ffe1b8445 /cc/raster/task_graph_runner.h | |
parent | 263435ba08cd291d9a0534719a599ad11098090a (diff) | |
download | chromium_src-05ca4bc9df381e6345f9cf7ee29cdfa075be30c4.zip chromium_src-05ca4bc9df381e6345f9cf7ee29cdfa075be30c4.tar.gz chromium_src-05ca4bc9df381e6345f9cf7ee29cdfa075be30c4.tar.bz2 |
TaskGraphRunner Group support
Adds a group to TaskGraphRunner, this can be used by an
implementation along with priority in order to decide how to execute
tasks.
This is a prerequisite patch for thread affinity changes which are
coming in a follow-up.
This patch causes a moderate (~15%) regression in cc_perftests for TaskGraphRunner.
The main regressions I'm seeing are:
In ScheduleTasks, we're seeing an additional 3% time spent in operator[] for the two new maps vs ToT.
We're also seeing an additional 5.5% of time spent in test code which builds the task graph.
Other regressions are less clear, but probably have to do with the additional cost of ScheduleTasks in the function body itself (inlined looping).
BUG=
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1489233003
Cr-Commit-Position: refs/heads/master@{#365140}
Diffstat (limited to 'cc/raster/task_graph_runner.h')
-rw-r--r-- | cc/raster/task_graph_runner.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/cc/raster/task_graph_runner.h b/cc/raster/task_graph_runner.h index b5ffade..181a455 100644 --- a/cc/raster/task_graph_runner.h +++ b/cc/raster/task_graph_runner.h @@ -46,19 +46,29 @@ class CC_EXPORT Task : public base::RefCountedThreadSafe<Task> { // A task dependency graph describes the order in which to execute a set // of tasks. Dependencies are represented as edges. Each node is assigned -// a priority and a run count that matches the number of dependencies. -// Priority range from 0 (most favorable scheduling) to UINT_MAX -// (least favorable). +// a category, a priority and a run count that matches the number of +// dependencies. Priority range from 0 (most favorable scheduling) to UINT16_MAX +// (least favorable). Categories range from 0 to UINT16_MAX. It is up to the +// implementation and its consumer to determine the meaning (if any) of a +// category. A TaskGraphRunner implementation may chose to prioritize certain +// categories over others, regardless of the individual priorities of tasks. struct CC_EXPORT TaskGraph { struct Node { typedef std::vector<Node> Vector; - Node(Task* task, size_t priority, size_t dependencies) - : task(task), priority(priority), dependencies(dependencies) {} + Node(Task* task, + uint16_t category, + uint16_t priority, + uint32_t dependencies) + : task(task), + category(category), + priority(priority), + dependencies(dependencies) {} Task* task; - size_t priority; - size_t dependencies; + uint16_t category; + uint16_t priority; + uint32_t dependencies; }; struct Edge { |