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

    https://github.com/apache/spark/pull/11636#discussion_r56744426
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/ExistingRDD.scala ---
    @@ -217,9 +222,16 @@ private[sql] case class DataSourceScan(
         // TODO: The abstractions between this class and SqlNewHadoopRDD makes 
it difficult to know
         // here which path to use. Fix this.
     
    -    ctx.INPUT_ROW = row
    +    // These assignments avoids accesses to instance variables in a 
while-loop
    +    // Since they are loop invariant variables (LIVs), host them outside 
the while-loop
    +    val colLocalVars = output.zipWithIndex.map(x => ctx.freshName("col" + 
x._2))
    +    val columnLIVAssigns = (colLocalVars zip colVars).map { case 
(localName, name) =>
    --- End diff --
    
    An access to an instance variable in ```colVars```, which requires 
```getField``` bytecode, would involve memory access. We expect that an access 
to a local variable in ```colLocalVars```, which requires ```aload``` bytecode, 
would use register access by a Java JIT compiler. 
    This is why we introduced ```colLocalVars```.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to