You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by sameeragarwal <gi...@git.apache.org> on 2016/08/01 19:44:59 UTC

[GitHub] spark pull request #14266: [SPARK-16526][SQL] Benchmarking Performance for F...

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

    https://github.com/apache/spark/pull/14266#discussion_r73040155
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/AggregateBenchmark.scala ---
    @@ -576,4 +576,605 @@ class AggregateBenchmark extends BenchmarkBase {
         benchmark.run()
       }
     
    -}
    +  // This test does not do any benchmark, instead it produces generated code for vectorized
    +  // and row-based hashmaps.
    +  ignore("generated code comparison for vectorized vs. rowbased") {
    +    val N = 20 << 23
    +
    +    sparkSession.conf.set("spark.sql.codegen.wholeStage", "true")
    +    sparkSession.conf.set("spark.sql.codegen.aggregate.map.columns.max", "30")
    +
    +    sparkSession.range(N)
    +      .selectExpr(
    +        "id & 1023 as k1",
    +        "cast (id & 1023 as string) as k2")
    +      .createOrReplaceTempView("test")
    +
    +    // dataframe/query
    +    val query = sparkSession.sql("select count(k1), sum(k1) from test group by k1, k2")
    +
    +    // vectorized
    +    sparkSession.conf.set("spark.sql.codegen.aggregate.map.enforce.impl", "vectorized")
    +    query.queryExecution.debug.codegen()
    +
    +    // row based
    +    sparkSession.conf.set("spark.sql.codegen.aggregate.map.enforce.impl", "rowbased")
    +    query.queryExecution.debug.codegen()
    +  }
    +
    +  ignore("1 key field, 1 value field, distinct linear keys") {
    +    val N = 20 << 22;
    +
    +    var timeStart: Long = 0L
    +    var timeEnd: Long = 0L
    +    var nsPerRow: Long = 0L
    +    var i = 0
    +    sparkSession.conf.set("spark.sql.codegen.wholeStage", "true")
    +    sparkSession.conf.set("spark.sql.codegen.aggregate.map.columns.max", "30")
    +
    +    // scalastyle:off
    +    println(Benchmark.getJVMOSInfo())
    --- End diff --
    
    nit: to minimize duplication, maybe create a small utility function that can then be reused in all test cases.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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