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

Issue 1767003002: [mojo-edk] Cache the context thread-local in the RequestContext. (Closed)

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

Description

[mojo-edk] Cache the context thread-local in the RequestContext. On MojoBindingsPerftest.InProcessPingPong, RequestContext's constructor and destructor combined consume ~22% of CPU time. The reason is that accessing a LazyInstance compiles down to a number of atomic operations, which are unnecessarily done twice in each of the constructor and destructor. Since the LazyInstance is leaky, it is safe to read the pointer once and cache it every time we need to access the thread-local. This change results in ~20% improvement in MojoBindingsPerftest.InProcessPingPong performance. The CPU usage is smaller but still noticable in MojoE2EPerftest with small messages. With a batch size of 1, this consumes ~4.5% of CPU time, rising to ~9% with a batch size of 10. BUG=590495 Committed: https://crrev.com/c8e9c39cfb8bef5e49c2e2b1437267eb165e2dae Cr-Commit-Position: refs/heads/master@{#379513}

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -5 lines) Patch
M mojo/edk/system/request_context.h View 2 chunks +9 lines, -0 lines 1 comment Download
M mojo/edk/system/request_context.cc View 3 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 10 (3 generated)
Anand Mistry (off Chromium)
4 years, 9 months ago (2016-03-07 04:21:40 UTC) #2
Ken Rockot(use gerrit already)
https://codereview.chromium.org/1767003002/diff/1/mojo/edk/system/request_context.h File mojo/edk/system/request_context.h (right): https://codereview.chromium.org/1767003002/diff/1/mojo/edk/system/request_context.h#newcode83 mojo/edk/system/request_context.h:83: base::ThreadLocalPointer<RequestContext>* tls_context_; Hmm, couldn't this just be a raw ...
4 years, 9 months ago (2016-03-07 04:25:00 UTC) #3
Ken Rockot(use gerrit already)
On 2016/03/07 at 04:25:00, Ken Rockot wrote: > https://codereview.chromium.org/1767003002/diff/1/mojo/edk/system/request_context.h > File mojo/edk/system/request_context.h (right): > > ...
4 years, 9 months ago (2016-03-07 04:25:22 UTC) #4
Anand Mistry (off Chromium)
On 2016/03/07 04:25:22, Ken Rockot wrote: > On 2016/03/07 at 04:25:00, Ken Rockot wrote: > ...
4 years, 9 months ago (2016-03-07 05:04:31 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1767003002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1767003002/1
4 years, 9 months ago (2016-03-07 05:05:03 UTC) #7
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 9 months ago (2016-03-07 05:27:32 UTC) #8
commit-bot: I haz the power
4 years, 9 months ago (2016-03-07 05:28:54 UTC) #10
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/c8e9c39cfb8bef5e49c2e2b1437267eb165e2dae
Cr-Commit-Position: refs/heads/master@{#379513}

Powered by Google App Engine
This is Rietveld 408576698