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

    https://github.com/apache/spark/pull/19083#discussion_r135988601
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
 ---
    @@ -1091,6 +1111,7 @@ object CodeGenerator extends Logging {
         }
     
         // Then walk the classes to get at the method bytecode.
    +    val methodsToByteCodeSize = mutable.ArrayBuffer[(String, Int)]()
    --- End diff --
    
    Since we know the number of methods right below (for each generated class, 
`cf.methodInfos` would give us the number of methods in that class, of which we 
expect almost all of them to have a `Code` attribute), making pre-sized arrays 
for each class and then concatenating those arrays into a `Seq` as the result 
would avoid potential resizing wastes from using a big default-sized 
`ArrayBuffer`.


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