Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-12142

Reduce overhead of MetricsEnvironment

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • None
    • 2.30.0
    • java-fn-execution
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              scwhittle Sam Whittle
              scwhittle Sam Whittle
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m