[ 
https://issues.apache.org/jira/browse/FLINK-2534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14699175#comment-14699175
 ] 

ASF GitHub Bot commented on FLINK-2534:
---------------------------------------

Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1029#discussion_r37166847
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java
 ---
    @@ -223,7 +223,7 @@ public CompactingHashTable(TypeSerializer<T> 
buildSideSerializer,
                // check the size of the first buffer and record it. all 
further buffers must have the same size.
                // the size must also be a power of 2
                this.segmentSize = memorySegments.get(0).size();
    -           if ( (this.segmentSize & this.segmentSize - 1) != 0) {
    +           if ((this.segmentSize & this.segmentSize - 1) != 0) {
    --- End diff --
    
    please avoid tiny formatting changes, they just clutter up the diff.


> Improve execution code in CompactingHashTable.java
> --------------------------------------------------
>
>                 Key: FLINK-2534
>                 URL: https://issues.apache.org/jira/browse/FLINK-2534
>             Project: Flink
>          Issue Type: Improvement
>          Components: Local Runtime
>    Affects Versions: 0.10
>            Reporter: Huang Wei
>             Fix For: 0.10
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> I found some improved code in CompactingHashTable.java since this code will 
> execute many times when flink runs.
> In my opinion, some codes in "for" and "while" can be optimized to reduce the 
> times of execution and it is effective to increase the performance.
> For example, the code following:
> 'while(numBuckets % numPartitions != 0) {
>                       numBuckets++;
>               }'
> can be optimized into a formula:
> numBuckets += numPartitions - (numBuckets % numPartitions);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to