[ https://issues.apache.org/jira/browse/BEAM-5987?focusedWorklogId=181818&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-181818 ]
ASF GitHub Bot logged work on BEAM-5987: ---------------------------------------- Author: ASF GitHub Bot Created on: 07/Jan/19 14:59 Start Date: 07/Jan/19 14:59 Worklog Time Spent: 10m Work Description: mareksimunek commented on pull request #7091: [BEAM-5987] Spark: Share cached side inputs between tasks. URL: https://github.com/apache/beam/pull/7091#discussion_r245680983 ########## File path: runners/spark/src/main/java/org/apache/beam/runners/spark/util/CachedSideInputReader.java ########## @@ -17,17 +17,31 @@ */ package org.apache.beam.runners.spark.util; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; +import com.google.common.cache.Cache; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.ExecutionException; import javax.annotation.Nullable; import org.apache.beam.runners.core.SideInputReader; +import org.apache.beam.runners.spark.util.SideInputStorage.Key; +import org.apache.beam.runners.spark.util.SideInputStorage.Value; import org.apache.beam.sdk.transforms.windowing.BoundedWindow; import org.apache.beam.sdk.values.PCollectionView; +import org.apache.spark.util.SizeEstimator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** {@link SideInputReader} that caches materialized views. */ public class CachedSideInputReader implements SideInputReader { + private static final Logger LOG = LoggerFactory.getLogger(CachedSideInputReader.class); + + /** + * Keep references for the whole lifecycle of CachedSideInputReader otherwise sideInput needs to + * be de-serialized again. + */ + private Set<?> sideInputReferences = new HashSet<>(); Review comment: references removed because different solution was used. [more](https://github.com/apache/beam/pull/7091#issuecomment-451961840) ---------------------------------------------------------------- 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: 181818) Time Spent: 3.5h (was: 3h 20m) > Spark SideInputReader performance > --------------------------------- > > Key: BEAM-5987 > URL: https://issues.apache.org/jira/browse/BEAM-5987 > Project: Beam > Issue Type: Bug > Components: runner-spark > Affects Versions: 2.8.0 > Reporter: David Moravek > Assignee: David Moravek > Priority: Major > Fix For: 2.9.0 > > Attachments: Screen Shot 2018-11-06 at 13.05.36.png > > Time Spent: 3.5h > Remaining Estimate: 0h > > We did some profiling of a spark job and 90% of the application time was > spent on side input deserialization. > For spark, an easy fix is to cache materialized side inputs per bundle. This > improved running time of the profiled job from 3 hours to 30 minutes. -- This message was sent by Atlassian JIRA (v7.6.3#76005)