[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2019-01-18 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=187161&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-187161
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 18/Jan/19 23:32
Start Date: 18/Jan/19 23:32
Worklog Time Spent: 10m 
  Work Description: kennknowles commented on issue #6909: BEAM-5933: avoid 
memory allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909#issuecomment-455721006
 
 
   You may mean that anything performance-related in the DirectRunner is a 
non-issue. Sometimes it seems that way, and it is true that it is focused on 
just being a fake for testing. But it is so bad that we really do need to 
improve it. Please keep reporting issues!
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 187161)
Time Spent: 1h 50m  (was: 1h 40m)

> PCollectionViews$SimplePCollectionView.hashCode allocates memory
> 
>
> Key: BEAM-5933
> URL: https://issues.apache.org/jira/browse/BEAM-5933
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Affects Versions: 2.8.0
>Reporter: Vojtech Janota
>Assignee: Vojtech Janota
>Priority: Trivial
> Fix For: 2.9.0
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2019-01-18 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=187159&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-187159
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 18/Jan/19 23:31
Start Date: 18/Jan/19 23:31
Worklog Time Spent: 10m 
  Work Description: kennknowles commented on issue #6909: BEAM-5933: avoid 
memory allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909#issuecomment-455720806
 
 
   @janotav you are quite right that this hidden contract is very suspicious. I 
have looked into the type hierarchy to investigate.
   
   The issue is that there are two desires in conflict: (1) a runner can 
deserialize a protobuf PCollectionView using just the tag, into whatever its 
runner-specific representation and (2) you can use PCollectionView as a key to 
retrieve values. Together, these force any subclass of PCollectionView should 
be equal (and equal hashcode) if their tags are equal, since runner's create 
proxy views or whatever. IMO this contract is broken, since the same tag but 
different `ViewFn` should not ever be equal.
   
   But if you want to gain the performance back, I bet you can roll forward and 
also just change here to match: 
https://github.com/apache/beam/blob/master/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/RunnerPCollectionView.java#L108
   
   Even better would be to port things to use the tag as the key into any 
implementation map.
   
   There is not even equals and hashcode on these subclasses in the Dataflow 
worker so I think that implies the tag is used directly: 
https://github.com/apache/beam/blob/master/runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/DataflowPortabilityPCollectionView.java
 and 
https://github.com/apache/beam/blob/master/runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/FetchAndFilterStreamingSideInputsOperation.java#L99
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 187159)
Time Spent: 1h 40m  (was: 1.5h)

> PCollectionViews$SimplePCollectionView.hashCode allocates memory
> 
>
> Key: BEAM-5933
> URL: https://issues.apache.org/jira/browse/BEAM-5933
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Affects Versions: 2.8.0
>Reporter: Vojtech Janota
>Assignee: Vojtech Janota
>Priority: Trivial
> Fix For: 2.9.0
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2019-01-17 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=186413&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-186413
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 17/Jan/19 16:42
Start Date: 17/Jan/19 16:42
Worklog Time Spent: 10m 
  Work Description: iemejia commented on issue #6909: BEAM-5933: avoid 
memory allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909#issuecomment-455235913
 
 
   @janotav 'anything performance related' **is an issue**, even if Direct 
Runner is a test runner, improvements in its performance benefit us all so 
don't hesitate to report them (or contribute fixes). Also your fix is in 
'sdks/java/core' so it benefits Everyone. It is really worth!
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 186413)
Time Spent: 1.5h  (was: 1h 20m)

> PCollectionViews$SimplePCollectionView.hashCode allocates memory
> 
>
> Key: BEAM-5933
> URL: https://issues.apache.org/jira/browse/BEAM-5933
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Affects Versions: 2.8.0
>Reporter: Vojtech Janota
>Assignee: Vojtech Janota
>Priority: Trivial
> Fix For: 2.9.0
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2019-01-17 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=186399&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-186399
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 17/Jan/19 16:28
Start Date: 17/Jan/19 16:28
Worklog Time Spent: 10m 
  Work Description: iemejia commented on issue #6909: BEAM-5933: avoid 
memory allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909#issuecomment-455236275
 
 
   Do you have more details on the metrics performance issue you mention, mind 
to create a JIRA please.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 186399)
Time Spent: 1h 20m  (was: 1h 10m)

> PCollectionViews$SimplePCollectionView.hashCode allocates memory
> 
>
> Key: BEAM-5933
> URL: https://issues.apache.org/jira/browse/BEAM-5933
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Affects Versions: 2.8.0
>Reporter: Vojtech Janota
>Assignee: Vojtech Janota
>Priority: Trivial
> Fix For: 2.9.0
>
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2019-01-17 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=186398&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-186398
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 17/Jan/19 16:27
Start Date: 17/Jan/19 16:27
Worklog Time Spent: 10m 
  Work Description: iemejia commented on issue #6909: BEAM-5933: avoid 
memory allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909#issuecomment-455235913
 
 
   @janotav 'anything performance related' **is an issue**, even if Direct 
Runner is a test runner, improvements in its performance benefit us all so 
don't hesitate to report them (or contribute fixes).
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 186398)
Time Spent: 1h 10m  (was: 1h)

> PCollectionViews$SimplePCollectionView.hashCode allocates memory
> 
>
> Key: BEAM-5933
> URL: https://issues.apache.org/jira/browse/BEAM-5933
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Affects Versions: 2.8.0
>Reporter: Vojtech Janota
>Assignee: Vojtech Janota
>Priority: Trivial
> Fix For: 2.9.0
>
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2019-01-17 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=186235&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-186235
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 17/Jan/19 09:12
Start Date: 17/Jan/19 09:12
Worklog Time Spent: 10m 
  Work Description: janotav commented on issue #6909: BEAM-5933: avoid 
memory allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909#issuecomment-455097247
 
 
   I have encountered this as a part of larger investigation into the 
performance aspects of our pipelines. The invocations were frequent enough to 
stand out in the memory profiler. I found it interesting that hash calculations 
needs to allocate memory and considering the high number of occurrences I 
thought this would be worth "fixing". Unfortunately I was not aware of this 
"hidden contract" that assumes particular hash implementation is necessary.
   
   Btw the overall improvement we were able to achieve in our pipelines was 
about 15% (7mins down to 6mins), but this can be predominantly (if not 
completely) attributed to removing the beam metrics collection in the 
DirectRunner. The load that beam metrics (in DirectRunner) put on the heap is 
massive (that extra minute basically went to GC activity), however, knowing 
that anything performance related is implicitly considered a non-issue I didn't 
report it. This high resource consumption is probably why FlinkRunner 
eventually added the option to disable metrics collection.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 186235)
Time Spent: 1h  (was: 50m)

> PCollectionViews$SimplePCollectionView.hashCode allocates memory
> 
>
> Key: BEAM-5933
> URL: https://issues.apache.org/jira/browse/BEAM-5933
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Affects Versions: 2.8.0
>Reporter: Vojtech Janota
>Assignee: Vojtech Janota
>Priority: Trivial
> Fix For: 2.9.0
>
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2019-01-16 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=185974&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-185974
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 16/Jan/19 20:23
Start Date: 16/Jan/19 20:23
Worklog Time Spent: 10m 
  Work Description: kennknowles commented on issue #6909: BEAM-5933: avoid 
memory allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909#issuecomment-454926181
 
 
   Out of curiosity, did you measure the allocation and its cost? Asking 
because we use this sort of practice a lot, since building your own hashCode is 
a mess and we don't use AutoValue enough. If it is expensive, we should inline 
a few versions of the call for low numbers of varargs.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 185974)
Time Spent: 50m  (was: 40m)

> PCollectionViews$SimplePCollectionView.hashCode allocates memory
> 
>
> Key: BEAM-5933
> URL: https://issues.apache.org/jira/browse/BEAM-5933
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Affects Versions: 2.8.0
>Reporter: Vojtech Janota
>Assignee: Vojtech Janota
>Priority: Trivial
> Fix For: 2.9.0
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2019-01-16 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=185973&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-185973
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 16/Jan/19 20:22
Start Date: 16/Jan/19 20:22
Worklog Time Spent: 10m 
  Work Description: kennknowles commented on issue #6909: BEAM-5933: avoid 
memory allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909#issuecomment-454926181
 
 
   Out of curiosity, did you measure the allocation and its cost?
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 185973)
Time Spent: 40m  (was: 0.5h)

> PCollectionViews$SimplePCollectionView.hashCode allocates memory
> 
>
> Key: BEAM-5933
> URL: https://issues.apache.org/jira/browse/BEAM-5933
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Affects Versions: 2.8.0
>Reporter: Vojtech Janota
>Assignee: Vojtech Janota
>Priority: Trivial
> Fix For: 2.9.0
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2019-01-16 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=185918&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-185918
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 16/Jan/19 18:10
Start Date: 16/Jan/19 18:10
Worklog Time Spent: 10m 
  Work Description: nielm commented on issue #6909: BEAM-5933: avoid memory 
allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909#issuecomment-454881875
 
 
   This PR causes 
[BEAM-6407](https://issues.apache.org/jira/browse/BEAM-6407)...
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 185918)
Time Spent: 0.5h  (was: 20m)

> PCollectionViews$SimplePCollectionView.hashCode allocates memory
> 
>
> Key: BEAM-5933
> URL: https://issues.apache.org/jira/browse/BEAM-5933
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Affects Versions: 2.8.0
>Reporter: Vojtech Janota
>Assignee: Vojtech Janota
>Priority: Trivial
> Fix For: 2.9.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2018-11-01 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=161598&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-161598
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 01/Nov/18 15:14
Start Date: 01/Nov/18 15:14
Worklog Time Spent: 10m 
  Work Description: iemejia closed pull request #6909: BEAM-5933: avoid 
memory allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionViews.java 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionViews.java
index 906ddecf72b..6c82cdc6fbb 100644
--- 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionViews.java
+++ 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionViews.java
@@ -29,7 +29,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
-import java.util.Objects;
 import javax.annotation.Nullable;
 import org.apache.beam.sdk.annotations.Experimental;
 import org.apache.beam.sdk.annotations.Experimental.Kind;
@@ -433,7 +432,7 @@ private SimplePCollectionView(
 
 @Override
 public int hashCode() {
-  return Objects.hash(tag);
+  return tag.hashCode();
 }
 
 @Override


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 161598)
Time Spent: 20m  (was: 10m)

> PCollectionViews$SimplePCollectionView.hashCode allocates memory
> 
>
> Key: BEAM-5933
> URL: https://issues.apache.org/jira/browse/BEAM-5933
> Project: Beam
>  Issue Type: Improvement
>  Components: sdk-java-core
>Affects Versions: 2.8.0
>Reporter: Vojtech Janota
>Assignee: Vojtech Janota
>Priority: Trivial
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (BEAM-5933) PCollectionViews$SimplePCollectionView.hashCode allocates memory

2018-11-01 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/BEAM-5933?focusedWorklogId=161580&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-161580
 ]

ASF GitHub Bot logged work on BEAM-5933:


Author: ASF GitHub Bot
Created on: 01/Nov/18 14:23
Start Date: 01/Nov/18 14:23
Worklog Time Spent: 10m 
  Work Description: janotav opened a new pull request #6909: BEAM-5933: 
avoid memory allocation in hashCode call
URL: https://github.com/apache/beam/pull/6909
 
 
   Avoid unwanted memory allocation currently done during invocation of
   
 
org.apache.beam.sdk.values.PCollectionViews$SimplePCollectionView.hashCode() 
   
   
   
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA 
issue, if applicable. This will automatically link the pull request to the 
issue.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   It will help us expedite review of your Pull Request if you tag someone 
(e.g. `@username`) to look at it.
   
   Post-Commit Tests Status (on master branch)
   

   
   Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark
   --- | --- | --- | --- | --- | --- | --- | ---
   Go | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/)
 | --- | --- | --- | --- | --- | ---
   Java | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/)
 [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/)
   Python | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/)
 | --- | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)
  [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/)
 | [![Build 
Status](https://builds.apache.org/job/beam_PostCommit_Python_VR_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python_VR_Flink/lastCompletedBuild/)
 | --- | --- | ---
   
   
   
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 161580)
Time Spent: 10m
Remaining Estimate: 0h

> PCollectionViews$SimplePCollecti