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

Issue 551183002: Microbenchmark for the cost of posting tasks to different pump types (Closed)

Created:
6 years, 3 months ago by jamesr
Modified:
6 years, 2 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, epenner
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Microbenchmark for the cost of posting tasks to different pump types This adds microbenchmarks to measure the cost of posting a task to a message loop running different pump types. This measures the wall and (where supported) thread time that elapses from different numbers of threads posting to one target. This is not designed to measure the time taken by the target thread or fairness of posting threads. Each test is set up with one target thread and 1-4 posting threads. The posting threads each run one task that posts batches of tasks to the target thread until they have been working for at least 5 seconds of wall time. The tasks on the target thread simply increment a counter. The test runner starts each posting thread, posts a start task to each then joins them and then joins the target thread and aggregates stats. BUG=412137 Committed: https://crrev.com/2e146d74f78041f91bd43562bd1a0210374a41eb Cr-Commit-Position: refs/heads/master@{#297264}

Patch Set 1 #

Total comments: 2

Patch Set 2 : naming, separate Start loop from first posted task #

Patch Set 3 : benchmark signalling a pump and posting a task separately #

Patch Set 4 : more realistic task posting benchmark #

Patch Set 5 : #

Total comments: 2

Patch Set 6 : remove format_macros.h includes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+334 lines, -13 lines) Patch
M base/android/java/src/org/chromium/base/JavaHandlerThread.java View 1 2 1 chunk +12 lines, -0 lines 0 comments Download
M base/android/java_handler_thread.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M base/android/java_handler_thread.cc View 1 2 2 chunks +14 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M base/message_loop/message_loop.h View 1 2 3 3 chunks +11 lines, -12 lines 0 comments Download
A base/message_loop/message_pump_perftest.cc View 1 2 3 1 chunk +294 lines, -0 lines 0 comments Download
M base/threading/thread_perftest.cc View 1 2 3 4 5 2 chunks +1 line, -1 line 0 comments Download

Messages

Total messages: 20 (2 generated)
jamesr
This seems to produce fairly stable times on linux and android and seems useful to ...
6 years, 3 months ago (2014-09-08 22:27:36 UTC) #2
jamesr
Example results from a linux z620: Posting to an I/O pump: From 1 thread: .2955104117647059 ...
6 years, 3 months ago (2014-09-08 22:40:07 UTC) #3
piman
On 2014/09/08 22:40:07, jamesr wrote: > Example results from a linux z620: > > Posting ...
6 years, 3 months ago (2014-09-09 01:16:02 UTC) #4
darin (slow to review)
I'm also very surprised to see MessagePumpDefault performing more poorly. https://codereview.chromium.org/551183002/diff/1/base/threading/thread_perftest.cc File base/threading/thread_perftest.cc (right): https://codereview.chromium.org/551183002/diff/1/base/threading/thread_perftest.cc#newcode304 ...
6 years, 3 months ago (2014-09-09 04:05:07 UTC) #5
darin (slow to review)
On 2014/09/09 04:05:07, darin wrote: > I'm also very surprised to see MessagePumpDefault performing more ...
6 years, 3 months ago (2014-09-09 04:09:09 UTC) #6
epenner
> > It's interesting to me that the default pump is actually the slowest in ...
6 years, 3 months ago (2014-09-09 04:40:16 UTC) #7
jamesr
On 2014/09/09 01:16:02, piman (Very slow to review) wrote: > The numbers are indeed surprising. ...
6 years, 3 months ago (2014-09-09 05:24:08 UTC) #8
darin (slow to review)
Is it possible that AddRef and Release are happening while locks are held? Maybe we ...
6 years, 3 months ago (2014-09-09 05:39:30 UTC) #9
jamesr
On 2014/09/09 04:09:09, darin wrote: > We should probably experiment with a POSIX-only implementation of ...
6 years, 3 months ago (2014-09-09 06:15:56 UTC) #10
darin (slow to review)
On 2014/09/09 06:15:56, jamesr wrote: > On 2014/09/09 04:09:09, darin wrote: > > We should ...
6 years, 3 months ago (2014-09-09 06:21:41 UTC) #11
jamesr
PS3 has separate benchmarks for the act of calling ScheduleWork() on a particular pump type ...
6 years, 3 months ago (2014-09-18 01:22:24 UTC) #12
Sami
Interesting. The cost in Java comes from the call to Java_SystemMessageHandler_scheduleWork, right? I'm not sure ...
6 years, 3 months ago (2014-09-18 16:19:36 UTC) #13
jamesr
This is proving useful enough that I'd like to land it and start tracking results ...
6 years, 2 months ago (2014-09-27 01:09:05 UTC) #14
darin (slow to review)
LGTM https://codereview.chromium.org/551183002/diff/80001/base/message_loop/message_loop.cc File base/message_loop/message_loop.cc (right): https://codereview.chromium.org/551183002/diff/80001/base/message_loop/message_loop.cc#newcode11 base/message_loop/message_loop.cc:11: #include "base/format_macros.h" nit: is this needed? https://codereview.chromium.org/551183002/diff/80001/base/threading/thread_perftest.cc File ...
6 years, 2 months ago (2014-09-28 03:42:20 UTC) #15
jamesr
On 2014/09/28 03:42:20, darin wrote: > https://codereview.chromium.org/551183002/diff/80001/base/message_loop/message_loop.cc > File base/message_loop/message_loop.cc (right): > > https://codereview.chromium.org/551183002/diff/80001/base/message_loop/message_loop.cc#newcode11 > ...
6 years, 2 months ago (2014-09-29 19:40:36 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/551183002/100001
6 years, 2 months ago (2014-09-29 19:41:33 UTC) #18
commit-bot: I haz the power
Committed patchset #6 (id:100001) as 03c33a488b5c38ee08fe7c8050736c05cf770f2a
6 years, 2 months ago (2014-09-29 21:13:34 UTC) #19
commit-bot: I haz the power
6 years, 2 months ago (2014-09-29 21:15:54 UTC) #20
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/2e146d74f78041f91bd43562bd1a0210374a41eb
Cr-Commit-Position: refs/heads/master@{#297264}

Powered by Google App Engine
This is Rietveld 408576698