diff options
author | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-29 05:21:37 +0000 |
---|---|---|
committer | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-29 05:21:37 +0000 |
commit | 7d73f676c7a12a52236136c8681dfeb95dd550b6 (patch) | |
tree | 0fc8ddd25d861eb2ab80259a063d608d3a68079e /cc/resources/task_graph_runner.h | |
parent | 44bab15b645a8dab8d391e212ab8d6976551f4bd (diff) | |
download | chromium_src-7d73f676c7a12a52236136c8681dfeb95dd550b6.zip chromium_src-7d73f676c7a12a52236136c8681dfeb95dd550b6.tar.gz chromium_src-7d73f676c7a12a52236136c8681dfeb95dd550b6.tar.bz2 |
cc: Add useful TaskGraphRunner performance tests.
Current perf tests are not useful for profiling as output heavily
depends on kernel scheduling. An improvement in CPU time is not
guaranteed to result in a better result from these tests as they
mostly measure context switching cost.
This includes a small refactor to TaskGraphRunner that allow us
to run tests on a single thread. The result is more predictable
results and useful profiling output.
The number of tasks used in tests have also been adjusted to more
realistic values.
BUG=338355
Review URL: https://codereview.chromium.org/147883003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247625 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/task_graph_runner.h')
-rw-r--r-- | cc/resources/task_graph_runner.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cc/resources/task_graph_runner.h b/cc/resources/task_graph_runner.h index af7c116..eb03467 100644 --- a/cc/resources/task_graph_runner.h +++ b/cc/resources/task_graph_runner.h @@ -142,6 +142,10 @@ class CC_EXPORT TaskGraphRunner : public base::DelegateSimpleThread::Delegate { void CollectCompletedTasks(NamespaceToken token, Task::Vector* completed_tasks); + // Run one task on current thread. Returns false if no tasks are ready + // to run. This should only be used by tests. + bool RunTaskForTesting(); + private: struct TaskNamespace { typedef std::vector<TaskNamespace*> Vector; @@ -192,6 +196,10 @@ class CC_EXPORT TaskGraphRunner : public base::DelegateSimpleThread::Delegate { // Overridden from base::DelegateSimpleThread: virtual void Run() OVERRIDE; + // Run next task. Caller must acquire |lock_| prior to calling this + // function and make sure at least one task is ready to run. + void RunTaskWithLockAcquired(int thread_index); + // This lock protects all members of this class. Do not read or modify // anything without holding this lock. Do not block while holding this // lock. |