Github user stanzhai commented on the issue:

    https://github.com/apache/spark/pull/19301
  
    @viirya 
    Benchmark code:
    
    ```scala
    val N = 500L << 22
    val benchmark = new Benchmark("agg", N)
    val expressions = (0 until 50).map(i => s"sum(id) as r$i")
    
    benchmark.addCase("agg with optimize", numIters = 2) { iter =>
      sparkSession.range(N).selectExpr(expressions: _*).collect()
    }
    
    benchmark.run()
    ```
    
    Result:
    
    ```
    Java HotSpot(TM) 64-Bit Server VM 1.8.0_91-b14 on Mac OS X 10.12.6
    Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
    
    agg:                                     Best/Avg Time(ms)    Rate(M/s)   
Per Row(ns)   Relative
    
------------------------------------------------------------------------------------------------
    agg with optimize                             1306 / 1354       1605.7      
     0.6       1.0X
    agg without optimize                      121799 / 148115         17.2      
    58.1       1.0X
    
    ```



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to