Sam Whittle created BEAM-12142:
----------------------------------
Summary: Reduce overhead of MetricsEnvironment
Key: BEAM-12142
URL: https://issues.apache.org/jira/browse/BEAM-12142
Project: Beam
Issue Type: Bug
Components: java-fn-execution
Reporter: Sam Whittle
Assignee: Sam Whittle
Currently the MetricsContainer objects are stored in ThreadLocal state. This
means that scoping a new container involves a get and a set of thread-local
state. By instead putting a wrapper object in the thread-local state we can use
a single-lookup in thread local state to get/set and then reset.
This is showing up as a possible 7% cpu improvement in a nexmark query benchmark
Additionally I think that removing from the threadlocal state is causing
overhead in get calls by causing the linear probing within the implementation
of ThreadLocal state to become more expensive.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)