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

Issue 190006: Make swapping the incoming queue with the work queue constant time.... (Closed)

Created:
11 years, 3 months ago by darin (slow to review)
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Make swapping the incoming queue with the work queue constant time. This is an alternative to the fix proposed here: http://codereview.chromium.org/172101 Credit goes to Dean McNamee for discovering this performance issue! R=deanm BUG=20204 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=25223

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -2 lines) Patch
M base/message_loop.h View 1 chunk +7 lines, -1 line 1 comment Download
M base/message_loop.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
eric.rannaud
There is either a typo or some missing code in the Swap() method. http://codereview.chromium.org/190006/diff/1/2 File ...
11 years, 3 months ago (2009-09-02 18:37:46 UTC) #1
darin (slow to review)
c is a protected member of std::queue. it reveals the underlying container class, which is ...
11 years, 3 months ago (2009-09-02 20:00:41 UTC) #2
Dean McNamee
LGTM. I don't know if you should call it Swap or swap(), whatever you think ...
11 years, 3 months ago (2009-09-02 20:01:19 UTC) #3
darin (slow to review)
I went with Swap to conform to google style. The name of the class similarly ...
11 years, 3 months ago (2009-09-02 20:04:18 UTC) #4
Dean McNamee
LGTM. I don't know if you should call it Swap or swap(), whatever you think ...
11 years, 3 months ago (2009-09-02 20:06:18 UTC) #5
brettw
11 years, 3 months ago (2009-09-02 20:37:16 UTC) #6
I think we should use Swap() as a member function to comply with Google style.

Sometimes you need to make a swap available for STL operations (it uses it as a
non-member function) in which case it should be lower case. STL will expect a
swap like
  void swap(T& a, T& b);
outside of your class.

Powered by Google App Engine
This is Rietveld 408576698