Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/984#discussion_r145292505
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/record/selection/SelectionVector4.java
 ---
    @@ -116,6 +116,14 @@ public void clear() {
         }
       }
     
    +  public static int getBatchIndex(int sv4Index) {
    +    return (sv4Index >> 16) & 0xFFFF;
    +  }
    +
    +  public static int getRecordIndex(int sv4Index) {
    +    return (sv4Index) & 0xFFFF;
    +  }
    --- End diff --
    
    I see you gave into the temptation to wrap these magic expressions in 
methods rather than repeating them over and over in generated code. The worry 
probably was that the overhead of a method call per value would be expensive. 
Did you do a bit of performance testing to demonstrate that Java inlines these 
methods so we get the same performance with this code as the original?


---

Reply via email to