Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1001)

Issue 962273002: Experimental: Chrome side of killing the blink timer heap (Closed)

Created:
5 years, 9 months ago by alex clarke (OOO till 29th)
Modified:
5 years, 8 months ago
Reviewers:
Sami, rmcilroy
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, ben+mojo_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, darin (slow to review), erikwright+watch_chromium.org, scheduler-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Experimental: Chrome side of killing the blink timer heap Not currently for review BUG=463143

Patch Set 1 #

Patch Set 2 : Minor tweaks #

Total comments: 12

Patch Set 3 : Some tests #

Patch Set 4 : Rebase! #

Patch Set 5 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+205 lines, -123 lines) Patch
M cc/test/ordered_simple_task_runner.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M cc/test/ordered_simple_task_runner.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/scheduler/task_queue_manager.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/scheduler/task_queue_manager.cc View 1 2 3 4 14 chunks +76 lines, -43 lines 0 comments Download
M content/renderer/scheduler/task_queue_manager_unittest.cc View 1 2 3 4 10 chunks +87 lines, -78 lines 0 comments Download
M content/renderer/scheduler/web_scheduler_impl.h View 2 chunks +4 lines, -0 lines 0 comments Download
M content/renderer/scheduler/web_scheduler_impl.cc View 1 2 2 chunks +16 lines, -1 line 0 comments Download
M mojo/services/html_viewer/webscheduler_impl.h View 1 chunk +3 lines, -0 lines 0 comments Download
M mojo/services/html_viewer/webscheduler_impl.cc View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (2 generated)
alex clarke (OOO till 29th)
5 years, 9 months ago (2015-02-27 17:43:40 UTC) #1
Sami
Doesn't seem too bad to me. Do we need to change the work queue yielding ...
5 years, 9 months ago (2015-02-27 18:22:33 UTC) #3
rmcilroy
https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc File content/renderer/scheduler/task_queue_manager.cc (right): https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc#newcode158 content/renderer/scheduler/task_queue_manager.cc:158: return true; drive-by comment: I'm wondering if it be ...
5 years, 9 months ago (2015-03-02 13:53:57 UTC) #5
alex clarke (OOO till 29th)
https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc File content/renderer/scheduler/task_queue_manager.cc (right): https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc#newcode158 content/renderer/scheduler/task_queue_manager.cc:158: return true; On 2015/03/02 13:53:57, rmcilroy wrote: > drive-by ...
5 years, 9 months ago (2015-03-02 16:08:10 UTC) #6
Sami
https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc File content/renderer/scheduler/task_queue_manager.cc (right): https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc#newcode158 content/renderer/scheduler/task_queue_manager.cc:158: return true; On 2015/03/02 16:08:10, alexclarke1 wrote: > On ...
5 years, 9 months ago (2015-03-02 16:38:33 UTC) #7
alex clarke (OOO till 29th)
On 2015/03/02 16:38:33, Sami wrote: > https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc > File content/renderer/scheduler/task_queue_manager.cc (right): > > https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc#newcode158 > ...
5 years, 9 months ago (2015-03-02 16:47:50 UTC) #8
alex clarke (OOO till 29th)
On 2015/03/02 16:47:50, alexclarke1 wrote: > On 2015/03/02 16:38:33, Sami wrote: > > > https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc ...
5 years, 9 months ago (2015-03-02 16:49:12 UTC) #9
alex clarke (OOO till 29th)
https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc File content/renderer/scheduler/task_queue_manager.cc (right): https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc#newcode128 content/renderer/scheduler/task_queue_manager.cc:128: while (!delayed_task_queue_.empty()) On 2015/02/27 18:22:33, Sami wrote: > Is ...
5 years, 9 months ago (2015-03-03 10:11:16 UTC) #10
rmcilroy
https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc File content/renderer/scheduler/task_queue_manager.cc (right): https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc#newcode128 content/renderer/scheduler/task_queue_manager.cc:128: while (!delayed_task_queue_.empty()) On 2015/03/03 10:11:15, alexclarke1 wrote: > On ...
5 years, 9 months ago (2015-03-03 10:22:21 UTC) #11
Sami
BTW, we'll probably want to hook up this timer suspension logic here too: https://code.google.com/p/chromium/codesearch#chromium/src/content/child/blink_platform_impl.cc&l=1220
5 years, 9 months ago (2015-03-03 10:46:48 UTC) #12
alex clarke (OOO till 29th)
https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc File content/renderer/scheduler/task_queue_manager.cc (right): https://codereview.chromium.org/962273002/diff/20001/content/renderer/scheduler/task_queue_manager.cc#newcode158 content/renderer/scheduler/task_queue_manager.cc:158: return true; On 2015/03/02 13:53:57, rmcilroy wrote: > drive-by ...
5 years, 9 months ago (2015-03-03 16:40:27 UTC) #13
alex clarke (OOO till 29th)
Shall we move forward with this patch? It's only pressing if we refactor the blink ...
5 years, 9 months ago (2015-03-05 17:57:53 UTC) #14
Sami
I think this is definitely worth doing given the amount of code we can delete ...
5 years, 9 months ago (2015-03-05 19:27:55 UTC) #15
alex clarke (OOO till 29th)
On 2015/03/05 19:27:55, Sami wrote: > I think this is definitely worth doing given the ...
5 years, 9 months ago (2015-03-06 13:57:56 UTC) #16
Sami
On 2015/03/06 13:57:56, alexclarke1 wrote: > On 2015/03/05 19:27:55, Sami wrote: > > I think ...
5 years, 9 months ago (2015-03-06 15:03:55 UTC) #17
alex clarke (OOO till 29th)
On 2015/03/06 15:03:55, Sami wrote: > On 2015/03/06 13:57:56, alexclarke1 wrote: > > On 2015/03/05 ...
5 years, 9 months ago (2015-03-06 15:07:15 UTC) #18
alex clarke (OOO till 29th)
On 2015/03/06 15:07:15, alexclarke1 wrote: > On 2015/03/06 15:03:55, Sami wrote: > > On 2015/03/06 ...
5 years, 9 months ago (2015-03-09 14:17:13 UTC) #19
Sami
5 years, 9 months ago (2015-03-16 20:17:15 UTC) #20
Here's what we talked about (and tell me if I misinterpreted):

- We seems to prefer a solution that would allow us to do some TQM-wide
optimization of the pending delayed tasks (but probably don't want to do
anything in the initial step).
- The above would suggest posting delayed tasks to the TQM and then back to the
individual work queues, which works but is a little roundabout.
- Having the logic *either* mostly in the TQM or the individual task queues
would nicely keep it in one place.
- I wanted to keep the individual queues unaware of delayed tasks, but I think
I've been convinced this was a pipe dream.
- IMO a nice property of the MessageLoop is that it never does work
O(number_of_pending_tasks) per run loop iteration. We should maintain that if we
can without horrible contortions.
- It's unclear if we need to maintain the interleaving of immediate and delayed
tasks like base does.

Based on the above I think I'm starting to warm up to the original idea of
having a separate delayed task heap in each task queue, because it keeps the
logic in one place and minimizes the back-and-forth task routing while still
allowing for a hypothetical hook in TQM that just coalesces across queues.

I'd suggest a couple of improvements to how this version implements it:  
- Instead of EnqueueTaskLocked try appending expired delayed tasks directly to
the work queue (and rely on DoWork calling us to do it when necessary) because
EnqueueTaskLocked can cause a DoWork to get posted.
- See if we can avoid calling Now() when there is no expired delayed work that
needs to be checked.

Powered by Google App Engine
This is Rietveld 408576698