Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions sql/core/benchmarks/WideTableBenchmark-results.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
================================================================================================
projection on wide table
================================================================================================

OpenJDK 64-Bit Server VM 1.8.0_191-b12 on Linux 3.10.0-862.3.2.el7.x86_64
Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
projection on wide table: Best/Avg Time(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------
split threshold 10 38932 / 39307 0.0 37128.1 1.0X
split threshold 100 31991 / 32556 0.0 30508.8 1.2X
split threshold 1024 10993 / 11041 0.1 10483.5 3.5X
split threshold 2048 8959 / 8998 0.1 8543.8 4.3X
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dongjoon-hyun In my mac, at most case, 2048 is the best.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it with openjdk (in one Linux VM), 2048 is also the best.

================================================================================================
projection on wide table
================================================================================================

OpenJDK 64-Bit Server VM 1.8.0_171-b10 on Linux 3.10.0-693.11.1.el7.x86_64
Intel Core Processor (Haswell)
projection on wide table:                Best/Avg Time(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------
split threshold 10                          23995 / 25673          0.0       22883.7       1.0X
split threshold 100                         12881 / 13419          0.1       12284.3       1.9X
split threshold 1024                          6435 / 7402          0.2        6137.2       3.7X
split threshold 2048                          5861 / 6766          0.2        5589.2       4.1X
split threshold 4096                          6464 / 7825          0.2        6164.6       3.7X
split threshold 8192                          7886 / 8742          0.1        7520.7       3.0X
split threshold 65536                       46143 / 48029          0.0       44005.6       0.5X

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yucai . I trust you. :) Don't worry about that. The scope of this PR is not for choosing the best option.

split threshold 4096 8116 / 8134 0.1 7739.8 4.8X
split threshold 8196 8069 / 8098 0.1 7695.5 4.8X
split threshold 65536 57068 / 57339 0.0 54424.3 0.7X


This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.spark.sql.execution.benchmark

import org.apache.spark.benchmark.Benchmark
import org.apache.spark.sql.internal.SQLConf

/**
* Benchmark to measure performance for wide table.
* {{{
* To run this benchmark:
* 1. without sbt: bin/spark-submit --class <this class>
* --jars <spark core test jar>,<spark catalyst test jar> <spark sql test jar>
* 2. build/sbt "sql/test:runMain <this class>"
* 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain <this class>"
* Results will be written to "benchmarks/WideTableBenchmark-results.txt".
* }}}
*/
object WideTableBenchmark extends SqlBasedBenchmark {

override def runBenchmarkSuite(mainArgs: Array[String]): Unit = {
runBenchmark("projection on wide table") {
val N = 1 << 20
val df = spark.range(N)
val columns = (0 until 400).map{ i => s"id as id$i"}
val benchmark = new Benchmark("projection on wide table", N, output = output)
Seq("10", "100", "1024", "2048", "4096", "8192", "65536").foreach { n =>
benchmark.addCase(s"split threshold $n", numIters = 5) { iter =>
withSQLConf(SQLConf.CODEGEN_METHOD_SPLIT_THRESHOLD.key -> n) {
df.selectExpr(columns: _*).foreach(identity(_))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, All.
It turns out that this breaks Scala-2.12 build. I made a PR to fix that. #22970

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks!

}
}
}
benchmark.run()
}
}
}