Chromium Code Reviews
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
Messages
Total messages: 10 (3 generated)
|
||||||||||||||||||||||||||||