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

Optimize PCollectionConsumerRegistry$MultiplexingMetricTrackingFnDataReceiver

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • None
    • Missing
    • sdk-java-harness
    • None

    Description

      In Nexmark benchmark profile this was using 2% of cpu on
      AbstractMapBasedMultimap$WrappedCollection$WrappedIterator
      methods.

      I believe this is due to the list returned here being a wrapper around the multiset.
      https://github.com/apache/beam/blob/8463a054c1d7e2b7ee8d11e9569e065cb5e02196/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/PCollectionConsumerRegistry.java#L172

      We iterate over this list many times for counters. It appears that we don't need a wrapped list as it is documented that all consumers should be registered first. So it seems we can just create a copy there to an immutable list and trivially save that cpu.

      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 10m
                  1h 10m