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

PCollectionViews$SimplePCollectionView.hashCode once again allocates memory (fix reverted, then fixed again)

Details

    • Improvement
    • Status: Open
    • P4
    • Resolution: Unresolved
    • 2.10.0
    • None
    • sdk-java-core

    Description

      I'm currently profiling memory consumption of our Beam pipeline and have noticed that

          org.apache.beam.sdk.values.PCollectionViews$SimplePCollectionView.hashCode()

      makes noticeable heap allocations. The implementation is:

          return Objects.hash(tag);

      That itself translates to:

          return Arrays.hashCode(values);

      Which performs implicit array creation in order to call:

          public static int Arrays.hashCode(Object a[]);

      Instead of the helper call, doing simple:

          tag.hashCode();

      Seems more appropriate.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              janotav Vojtech Janota

              Dates

                Created:
                Updated:

                Slack

                  Issue deployment