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

Issue 1448233002: Avoid iterating over all handles in MessagePumpMojo on every iteration to calculate deadlines. (Closed)

Created:
5 years, 1 month ago by Anand Mistry (off Chromium)
Modified:
5 years, 1 month ago
Reviewers:
sky
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid iterating over all handles in MessagePumpMojo on every iteration to calculate deadlines. Instead of iterating over every handle, only iterate over those that have a deadline set (and hence can expire). This requires tracking which handles have deadlines. A better solution would be to use a priority queue to track the closest deadline. However, it turns out that no-one currently uses deadlines here, so the size of |deadline_handles_| will always be 0. BUG=556865 Committed: https://crrev.com/e8de0bc0f5403012fa125c1dc94e82744a270eb7 Cr-Commit-Position: refs/heads/master@{#361291}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -20 lines) Patch
M mojo/message_pump/message_pump_mojo.h View 2 chunks +5 lines, -0 lines 0 comments Download
M mojo/message_pump/message_pump_mojo.cc View 1 4 chunks +36 lines, -20 lines 0 comments Download

Messages

Total messages: 19 (4 generated)
Anand Mistry (off Chromium)
This change eliminates two O(handles) loops on every message loop iteration; in MessagePumpMojo::GetDeadlineForWait(), and the ...
5 years, 1 month ago (2015-11-17 06:21:14 UTC) #2
sky
https://codereview.chromium.org/1448233002/diff/1/mojo/message_pump/message_pump_mojo.cc File mojo/message_pump/message_pump_mojo.cc (right): https://codereview.chromium.org/1448233002/diff/1/mojo/message_pump/message_pump_mojo.cc#newcode230 mojo/message_pump/message_pump_mojo.cc:230: for (auto h : expired_handles) { auto& . And ...
5 years, 1 month ago (2015-11-17 18:35:11 UTC) #3
Anand Mistry (off Chromium)
https://codereview.chromium.org/1448233002/diff/1/mojo/message_pump/message_pump_mojo.cc File mojo/message_pump/message_pump_mojo.cc (right): https://codereview.chromium.org/1448233002/diff/1/mojo/message_pump/message_pump_mojo.cc#newcode230 mojo/message_pump/message_pump_mojo.cc:230: for (auto h : expired_handles) { On 2015/11/17 18:35:11, ...
5 years, 1 month ago (2015-11-17 23:54:40 UTC) #4
sky
https://codereview.chromium.org/1448233002/diff/1/mojo/message_pump/message_pump_mojo.h File mojo/message_pump/message_pump_mojo.h (right): https://codereview.chromium.org/1448233002/diff/1/mojo/message_pump/message_pump_mojo.h#newcode124 mojo/message_pump/message_pump_mojo.h:124: std::set<Handle> deadline_handles_; On 2015/11/17 23:54:39, Anand Mistry wrote: > ...
5 years, 1 month ago (2015-11-17 23:58:42 UTC) #5
Anand Mistry (off Chromium)
https://codereview.chromium.org/1448233002/diff/1/mojo/message_pump/message_pump_mojo.h File mojo/message_pump/message_pump_mojo.h (right): https://codereview.chromium.org/1448233002/diff/1/mojo/message_pump/message_pump_mojo.h#newcode124 mojo/message_pump/message_pump_mojo.h:124: std::set<Handle> deadline_handles_; On 2015/11/17 23:58:42, sky wrote: > On ...
5 years, 1 month ago (2015-11-18 00:10:12 UTC) #6
sky
Wouldn't a set<Handler*> with a comparator that orders based on deadline solve this? -Scott On ...
5 years, 1 month ago (2015-11-18 00:47:00 UTC) #7
Anand Mistry (off Chromium)
On 18 November 2015 at 11:46, Scott Violet <sky@chromium.org> wrote: > Wouldn't a set<Handler*> with ...
5 years, 1 month ago (2015-11-18 00:59:12 UTC) #8
Anand Mistry (off Chromium)
Ping!
5 years, 1 month ago (2015-11-23 23:07:55 UTC) #9
sky
I thought you were investigating separate structures. LGTM
5 years, 1 month ago (2015-11-24 00:18:27 UTC) #10
Anand Mistry (off Chromium)
On 2015/11/24 00:18:27, sky wrote: > I thought you were investigating separate structures. LGTM Oh, ...
5 years, 1 month ago (2015-11-24 00:28:35 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1448233002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1448233002/20001
5 years, 1 month ago (2015-11-24 00:30:43 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/133269)
5 years, 1 month ago (2015-11-24 03:38:37 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1448233002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1448233002/20001
5 years, 1 month ago (2015-11-24 08:12:10 UTC) #17
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 1 month ago (2015-11-24 08:42:56 UTC) #18
commit-bot: I haz the power
5 years, 1 month ago (2015-11-24 08:44:05 UTC) #19
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/e8de0bc0f5403012fa125c1dc94e82744a270eb7
Cr-Commit-Position: refs/heads/master@{#361291}

Powered by Google App Engine
This is Rietveld 408576698