StefanRRichter commented on a change in pull request #8409: [FLINK-12478] 
Decompose monolithic run-loops in StreamTask implementa…
URL: https://github.com/apache/flink/pull/8409#discussion_r284663084
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/OneInputStreamTask.java
 ##########
 @@ -98,13 +96,8 @@ public void init() throws Exception {
        }
 
        @Override
-       protected void run() throws Exception {
-               // cache processor reference on the stack, to make the code 
more JIT friendly
-               final StreamInputProcessor<IN> inputProcessor = 
this.inputProcessor;
-
-               while (running && inputProcessor.processInput()) {
-                       // all the work happens in the "processInput" method
-               }
+       protected boolean performDefaultAction() throws Exception {
 
 Review comment:
   I ran the following:
   ```
                env.setParallelism(1);
                source
                        .map(new MultiplyByTwo())
                        .addSink(new DiscardingSink<>());
   
   master:
   Benchmark                          Mode  Cnt      Score     Error   Units
   SumLongsBenchmark.benchmarkCount  thrpt   30  16240.866 ± 311.845  ops/ms
   
   master + #8442:
   Benchmark                          Mode  Cnt      Score     Error   Units
   SumLongsBenchmark.benchmarkCount  thrpt   30  16540.537 ± 295.100  ops/ms
   ```
   
   ```
                env.setParallelism(1);
                source
                        .map(new MultiplyByTwo())
                        .rebalance()
                        .map((x) -> x)
                        .addSink(new DiscardingSink<>());
   
   master:
   Benchmark                          Mode  Cnt     Score     Error   Units
   SumLongsBenchmark.benchmarkCount  thrpt   30  9715.334 ± 170.632  ops/ms
   
   master + #8442:
   Benchmark                          Mode  Cnt     Score     Error   Units
   SumLongsBenchmark.benchmarkCount  thrpt   30  9932.752 ± 124.494  ops/ms
   ```
   
   I would conclude the changes run as fast or a notch faster than master on my 
local machine.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to