[ 
https://issues.apache.org/jira/browse/SPARK-15742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Josh Rosen resolved SPARK-15742.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 2.0.0

Issue resolved by pull request 13484
[https://github.com/apache/spark/pull/13484]

> Reduce collections allocations in Catalyst tree transformation methods
> ----------------------------------------------------------------------
>
>                 Key: SPARK-15742
>                 URL: https://issues.apache.org/jira/browse/SPARK-15742
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Josh Rosen
>            Assignee: Josh Rosen
>             Fix For: 2.0.0
>
>
> In Catalyst's TreeNode {{transform}} methods we end up calling 
> {{productIterator.map(...).toArray()}} in a number of places, which is 
> slightly inefficient because it needs to allocate and grow ArrayBuilders. 
> Since we already know the size of the final output ({{productArity}}), we can 
> simply allocate an array up-front and use a while loop to consume the 
> iterator and populate the array.
> For most workloads, this performance difference is negligible but it does 
> make a measurable difference in optimizer performance for queries that 
> operate over very wide schemas (thousands of columns).



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

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

Reply via email to