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

ASF GitHub Bot logged work on BEAM-7574:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Jul/19 13:45
            Start Date: 26/Jul/19 13:45
    Worklog Time Spent: 10m 
      Work Description: je-ik commented on pull request #8946: [BEAM-7574] fix 
Combine performance for SparkRunner
URL: https://github.com/apache/beam/pull/8946#discussion_r307748132
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/util/WindowedValue.java
 ##########
 @@ -177,11 +182,19 @@ public int hashCode() {
   private static final Collection<? extends BoundedWindow> GLOBAL_WINDOWS =
       Collections.singletonList(GlobalWindow.INSTANCE);
 
+  /** A {@link WindowedValue} which holds exactly single window per value. */
+  public interface SingleWindowedValue {
 
 Review comment:
   The difference is exactly as you mention - every call creates a (useless) 
instance of singleton, which then has to be garbage collected and creates a lot 
of pressure on the young generation. Removing that had about 25% of performance 
improvement (because application could concentrate on business logic instead of 
GC). I admit that the test job I used was a little special - it used a LOT of 
windows (30 second windows over 2 year interval) with only quite a few keys. 
Nevertheless, creating less instances is always good for GC. :-)
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 283365)
    Time Spent: 6h 40m  (was: 6.5h)

> Spark runner: Combine.perKey performance issues
> -----------------------------------------------
>
>                 Key: BEAM-7574
>                 URL: https://issues.apache.org/jira/browse/BEAM-7574
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-spark
>    Affects Versions: 2.13.0
>            Reporter: Jan Lukavský
>            Assignee: Jan Lukavský
>            Priority: Major
>          Time Spent: 6h 40m
>  Remaining Estimate: 0h
>
> Combine.perKey on current implementation uses technique of creating an 
> accumulator for each input key and then merge all these accumulators 
> together. Optimize this by:
>  * changing accumulator from Iterable to Map, and using addInput as much as 
> possible
>  * try to move the window explode to pre-shuffle (add window label to key for 
> non-merging windows), measure the impact, and if the impact is substantial, 
> implement that for at leasit window functions assigning to single (global) 
> window or single window per element (tumbling windows)



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to