[ https://issues.apache.org/jira/browse/BEAM-12142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anonymous updated BEAM-12142: ----------------------------- Status: Triage Needed (was: Triage Needed) > 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 > Priority: P2 > Fix For: 2.30.0 > > Time Spent: 1h 40m > Remaining Estimate: 0h > > 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.20.10#820010)