From 8c8cc1488454c07aa07c6bb11c4ba84463bcca7d Mon Sep 17 00:00:00 2001 From: "skyostil@chromium.org" Date: Wed, 27 Feb 2013 22:02:16 +0000 Subject: cc: Check for cheap task completion sooner Instead of using the normal 6 ms period to poll for cheap task completion, do the check immediately after running a batch of cheap tasks. This improves cheap task completion latency. In order to avoid disturbing the scheduling of normal task completion, this optimization is only performed if there are no pending non-cheap tasks. BUG=178441 Review URL: https://chromiumcodereview.appspot.com/12321140 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185051 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/worker_pool.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cc/worker_pool.cc') diff --git a/cc/worker_pool.cc b/cc/worker_pool.cc index 5e7c681..77e6139 100644 --- a/cc/worker_pool.cc +++ b/cc/worker_pool.cc @@ -391,7 +391,10 @@ void WorkerPool::RunCheapTasks() { pending_cheap_tasks_.take_front(); PostTask(task.Pass(), false); } + run_cheap_tasks_pending_ = false; + if (base::subtle::Acquire_Load(&pending_task_count_) == 0) + OnIdle(); } } // namespace cc -- cgit v1.1