Vojta you are right, your implementation seems like a good improvement.
Can you please create a JIRA and eventually if you are interested do a
PR to contribute a fix for it.

Regards,
Ismaël
On Wed, Oct 31, 2018 at 2:18 PM Vojtech Janota <[email protected]> wrote:
>
> Hi,
>
> 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[]);
>
> Am I right that changing the SimplePCollectionView implementation to a simple:
>
> return tag.hashCode();
>
> Is the right thing to do?
>
> Regards,
> Vojta

Reply via email to