commit | 0c17bc4823f8506061a7f20935f95f0d71d4ad5c | [log] [tgz] |
---|---|---|
author | Alex Clarke <alexclarke@chromium.org> | Fri Jan 11 11:39:05 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Jan 11 11:39:05 2019 |
tree | 6789b94fb461946a32d5cfc8982a9723b632e907 | |
parent | 5ba5360721c32abb11bf570e6963c8f3595a3894 [diff] |
Reland [Optimize TaskQueueSelector] The previous patch was starving low priorirty tasks more by accident which was enough to make some layout tests "leak" blink objects. Previous patch: http://crrev.com/c/1397612 This patch reimplements the priority selection logic by maintaining a priority queue of task priorities. I.e. to select a task we first check the current highest priority priority with tasks and then select the oldest queue from within that priority. To account for task starvation we keep a count of the number of times we have selected a task, and assign each priority a sort key based on the current task count plus a priority specific bias. After selecting a queue, we re-evaluate the sort key for the associated priority. This means if we run a lot of say high priority tasks, the sort key for any waiting normal priority will eventually become lower than the key for the high priority, resulting in us selecting a "starving" normal priority queue. Despite the overhead of maintaining this new queue, it's still makes a 4% improvement on SequenceManagerPerfTest.PostImmediateTasks_OneQueue. Bug: 897751 Change-Id: Ia7737343f1a82f190802e0da1ed16989cf10e14e Reviewed-on: https://chromium-review.googlesource.com/c/1404091 Commit-Queue: Alex Clarke <alexclarke@chromium.org> Reviewed-by: Alexander Timin <altimin@chromium.org> Reviewed-by: Sami Kyöstilä <skyostil@chromium.org> Cr-Commit-Position: refs/heads/master@{#621976}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .