-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25676][SQL][TEST] Rename and refactor BenchmarkWideTable to use main method #22823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
64e76e2
[SPARK-25676][SQL][TEST] Refactor BenchmarkWideTable to use main method
yucai 83857d0
minor
yucai f714cc8
rebase
yucai edaa5a9
Update result
dongjoon-hyun a755039
Merge pull request #7 from dongjoon-hyun/PR-22823
610fc31
8196 -> 8192
yucai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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 | ||
|
|
||
|
|
||
52 changes: 0 additions & 52 deletions
52
sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/BenchmarkWideTable.scala
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/WideTableBenchmark.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(_)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, All.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, thanks! |
||
| } | ||
| } | ||
| } | ||
| benchmark.run() | ||
| } | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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,
2048is the best.There was a problem hiding this comment.
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),
2048is also the best.There was a problem hiding this comment.
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.