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

Issue 2419793002: [Reland] Optimize blink scheduler with an intrusive heap (Closed)

Created:
4 years, 2 months ago by alex clarke (OOO till 29th)
Modified:
4 years, 2 months ago
CC:
blink-reviews, chromium-reviews, scheduler-bugs_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Reland] Optimize blink scheduler with an intrusive heap. This shows a ~10% improvement on the TaskQueueManagerPerfTest micro benchmark. Alternatives considered: A flat map/set https://codereview.chromium.org/2396533004/ BUG= Committed: https://crrev.com/36d98e3b544f310943986dcaa98beabacdbccc96 Committed: https://crrev.com/1e13bd23dd2aac48f6bbcce65a1c56b14d5254ef Committed: https://crrev.com/efc263f7724823965b63cf2b7ff367288e526629 Cr-Original-Original-Commit-Position: refs/heads/master@{#425647} Cr-Original-Commit-Position: refs/heads/master@{#425930} Cr-Commit-Position: refs/heads/master@{#426467}

Patch Set 1 #

Patch Set 2 : Add test #

Patch Set 3 : Fix bug in MoveHoleDown #

Total comments: 32

Patch Set 4 : Responding to feedback #

Patch Set 5 : Minor changes for clarity #

Patch Set 6 : Rename some variables and methods for clarity #

Patch Set 7 : Fix variable name #

Patch Set 8 : Tiny optimization of MoveHoleDownAndFillWithLeafElement #

Total comments: 22

Patch Set 9 : Add a is_heap check plus fix bug with DelayedWakeup comparison operator #

Patch Set 10 : Remove BLINK_PLATFORM_EXPORT because compile was failing on windows #

Patch Set 11 : Small Refactor #

Patch Set 12 : The bug was in intrusiveHeap::end, now fixed #

Patch Set 13 : Fix the TimeDomain::MigrateQueue bug plus optimize TimeDomain::ScheduleDelayedWork #

Patch Set 14 : Fix implicit casts #

Patch Set 15 : Fixed perf test and increaced test coverage #

Unified diffs Side-by-side diffs Delta from patch set Stats (+777 lines, -130 lines) Patch
M third_party/WebKit/Source/platform/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +224 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/scheduler/base/intrusive_heap_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +359 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_perftest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +36 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/time_domain.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +27 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/time_domain.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +40 lines, -55 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/time_domain_unittest.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/work_queue.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/work_queue_sets.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +19 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/work_queue_sets.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +32 lines, -53 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/work_queue_sets_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 99 (67 generated)
alex clarke (OOO till 29th)
The IntrusiveHeap seems to be marginally faster than FlatHeap/Set for the scheduler use case. It's ...
4 years, 2 months ago (2016-10-13 14:19:09 UTC) #4
haraken
+yutak I haven't looked at the details but am fine with adding IntrusiveHeap to scheduler/.
4 years, 2 months ago (2016-10-14 07:00:01 UTC) #12
Sami
Overall looks great, although I also didn't go through the heap logic with a fine ...
4 years, 2 months ago (2016-10-14 07:26:17 UTC) #13
haraken
IntrusiveHeap LGTM with comments. altimin@: Would you review the scheduler part? https://codereview.chromium.org/2419793002/diff/40001/third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h File third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h (right): ...
4 years, 2 months ago (2016-10-14 13:12:26 UTC) #15
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/2419793002/diff/40001/third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h File third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h (right): https://codereview.chromium.org/2419793002/diff/40001/third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h#newcode11 third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h:11: #include "public/platform/WebCommon.h" On 2016/10/14 13:12:26, haraken wrote: > ...
4 years, 2 months ago (2016-10-14 13:55:36 UTC) #16
alex clarke (OOO till 29th)
https://codereview.chromium.org/2419793002/diff/40001/third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h File third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h (right): https://codereview.chromium.org/2419793002/diff/40001/third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h#newcode20 third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h:20: class BLINK_PLATFORM_EXPORT IntrusiveHeap { On 2016/10/14 13:12:25, haraken wrote: ...
4 years, 2 months ago (2016-10-14 14:52:38 UTC) #27
altimin
https://codereview.chromium.org/2419793002/diff/140001/third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h File third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h (right): https://codereview.chromium.org/2419793002/diff/140001/third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h#newcode18 third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h:18: // 2. T has method void SetHeapIndex(size_t index) 3. ...
4 years, 2 months ago (2016-10-14 17:06:37 UTC) #34
alex clarke (OOO till 29th)
https://codereview.chromium.org/2419793002/diff/140001/third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h File third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h (right): https://codereview.chromium.org/2419793002/diff/140001/third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h#newcode18 third_party/WebKit/Source/platform/scheduler/base/intrusive_heap.h:18: // 2. T has method void SetHeapIndex(size_t index) On ...
4 years, 2 months ago (2016-10-14 21:49:46 UTC) #38
haraken
IntrusiveHeap LGTM Maybe IntrusiveBinaryHeap or IndexedBinaryHeap sounds better (at first I thought IntrusiveHeap is a ...
4 years, 2 months ago (2016-10-15 01:58:14 UTC) #42
altimin
lgtm
4 years, 2 months ago (2016-10-17 09:04:40 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2419793002/200001
4 years, 2 months ago (2016-10-17 10:17:10 UTC) #48
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 2 months ago (2016-10-17 10:23:32 UTC) #49
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/36d98e3b544f310943986dcaa98beabacdbccc96 Cr-Commit-Position: refs/heads/master@{#425647}
4 years, 2 months ago (2016-10-17 10:25:37 UTC) #51
henrika (OOO until Aug 14)
A revert of this CL (patchset #11 id:200001) has been created in https://codereview.chromium.org/2421283002/ by henrika@chromium.org. ...
4 years, 2 months ago (2016-10-17 11:06:55 UTC) #52
henrika (OOO until Aug 14)
A revert of this CL (patchset #11 id:200001) has been created in https://codereview.chromium.org/2424003002/ by henrika@chromium.org. ...
4 years, 2 months ago (2016-10-17 12:47:24 UTC) #53
alex clarke (OOO till 29th)
Looks like the problem was an off-by one bug with std::is_heap. According to the docs ...
4 years, 2 months ago (2016-10-17 15:01:32 UTC) #55
alex clarke (OOO till 29th)
On closer inspection, the bug was this: T* end() const { return &nodes_[size_ + 1]; ...
4 years, 2 months ago (2016-10-17 15:47:55 UTC) #57
alex clarke (OOO till 29th)
PTAL
4 years, 2 months ago (2016-10-17 15:50:16 UTC) #59
haraken
LGTM to reland
4 years, 2 months ago (2016-10-17 15:52:42 UTC) #62
ojan
What did you use to measure performance impact? In the future, please include in the ...
4 years, 2 months ago (2016-10-17 18:27:31 UTC) #66
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2419793002/240001
4 years, 2 months ago (2016-10-18 09:14:24 UTC) #71
alex clarke (OOO till 29th)
Done.
4 years, 2 months ago (2016-10-18 09:14:26 UTC) #72
commit-bot: I haz the power
Committed patchset #12 (id:240001)
4 years, 2 months ago (2016-10-18 09:20:01 UTC) #74
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/1e13bd23dd2aac48f6bbcce65a1c56b14d5254ef Cr-Commit-Position: refs/heads/master@{#425930}
4 years, 2 months ago (2016-10-18 09:21:59 UTC) #76
ojan
On 2016/10/18 at 09:14:26, alexclarke wrote: > Done. Oh nice. Somehow I misread this and ...
4 years, 2 months ago (2016-10-18 16:42:40 UTC) #77
alex clarke (OOO till 29th)
A revert of this CL (patchset #12 id:240001) has been created in https://codereview.chromium.org/2428073002/ by alexclarke@chromium.org. ...
4 years, 2 months ago (2016-10-18 16:55:19 UTC) #78
alex clarke (OOO till 29th)
On 2016/10/18 16:55:19, alex clarke wrote: > A revert of this CL (patchset #12 id:240001) ...
4 years, 2 months ago (2016-10-19 09:28:22 UTC) #80
alex clarke (OOO till 29th)
PTAL
4 years, 2 months ago (2016-10-20 12:34:12 UTC) #91
haraken
LGTM
4 years, 2 months ago (2016-10-20 13:41:15 UTC) #92
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2419793002/300001
4 years, 2 months ago (2016-10-20 13:42:25 UTC) #95
commit-bot: I haz the power
Committed patchset #15 (id:300001)
4 years, 2 months ago (2016-10-20 13:52:13 UTC) #97
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 13:18:01 UTC) #99
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/efc263f7724823965b63cf2b7ff367288e526629
Cr-Commit-Position: refs/heads/master@{#426467}

Powered by Google App Engine
This is Rietveld 408576698