Skip to content

Commit

Permalink
add benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Davies Liu committed Mar 15, 2016
1 parent 3298319 commit 7471741
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import org.apache.spark.util.Benchmark
class BenchmarkWholeStageCodegen extends SparkFunSuite {
lazy val conf = new SparkConf().setMaster("local[1]").setAppName("benchmark")
.set("spark.sql.shuffle.partitions", "1")
.set("spark.sql.autoBroadcastJoinThreshold", "0")
.set("spark.sql.autoBroadcastJoinThreshold", "1")
lazy val sc = SparkContext.getOrCreate(conf)
lazy val sqlContext = SQLContext.getOrCreate(sc)

Expand Down Expand Up @@ -200,6 +200,18 @@ class BenchmarkWholeStageCodegen extends SparkFunSuite {
outer join w long codegen=false 15280 / 16497 6.9 145.7 1.0X
outer join w long codegen=true 769 / 796 136.3 7.3 19.9X
*/

runBenchmark("semi join w long", N) {
sqlContext.range(N).join(dim, (col("id") bitwiseAND M) === col("k"), "leftsemi").count()
}

/**
Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
semi join w long: Best/Avg Time(ms) Rate(M/s) Per Row(ns) Relative
-------------------------------------------------------------------------------------------
semi join w long codegen=false 5804 / 5969 18.1 55.3 1.0X
semi join w long codegen=true 814 / 934 128.8 7.8 7.1X
*/
}

ignore("sort merge join") {
Expand Down

0 comments on commit 7471741

Please sign in to comment.