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

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

                Author: ASF GitHub Bot
            Created on: 24/Sep/19 21:11
            Start Date: 24/Sep/19 21:11
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on pull request #9445: [BEAM-6668] 
Use add experiment methods
URL: https://github.com/apache/beam/pull/9445#discussion_r327836431
 
 

 ##########
 File path: 
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineTranslator.java
 ##########
 @@ -327,18 +328,15 @@ public Job translate(List<DataflowPackage> packages) {
       // not enabled.
       if (options.isEnableStreamingEngine()) {
         List<String> experiments = options.getExperiments();
-        if (experiments == null) {
-          experiments = new ArrayList<String>();
-        } else {
-          experiments = new ArrayList<String>(experiments);
-        }
         if (!experiments.contains(GcpOptions.STREAMING_ENGINE_EXPERIMENT)) {
           experiments.add(GcpOptions.STREAMING_ENGINE_EXPERIMENT);
         }
         if (!experiments.contains(GcpOptions.WINDMILL_SERVICE_EXPERIMENT)) {
           experiments.add(GcpOptions.WINDMILL_SERVICE_EXPERIMENT);
         }
-        options.setExperiments(experiments);
+        experiments
+            .parallelStream()
 
 Review comment:
   parallel stream? I don't think we need to use multiple threads to do this.
   
   Also, streams are [significantly 
slower](https://medium.com/@milan.mimica/slow-like-a-stream-fast-like-a-loop-524f70391182)
 then for loops even in JDK 12. You need to have 100k+ elements for parallel 
stream to beat stream and millions for parallel stream to beat for loop.
 
----------------------------------------------------------------
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: 317846)
    Time Spent: 2h 20m  (was: 2h 10m)

> use add experiment methods (Java and Python)
> --------------------------------------------
>
>                 Key: BEAM-6668
>                 URL: https://issues.apache.org/jira/browse/BEAM-6668
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-gcp, sdk-py-core
>            Reporter: Udi Meiri
>            Priority: Minor
>              Labels: beginner, easyfix, newbie
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Python:
> Convert instances of experiments.append(...)
> to debug_options.add_experiment(...)
> Java:
> Use ExperimentalOptions.addExperiment(...)
> instead of getExperiments(), modify, setExperiments() pattern.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to