-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-31471][TESTS][BUILD] Add a python script to run multiple benchmarks #28244
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
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,54 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# | ||
# 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. | ||
# | ||
|
||
import os | ||
from sparktestsupport.shellutils import run_cmd | ||
|
||
benchmarks = [ | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.AggregateBenchmark'], | ||
['avro/test', 'org.apache.spark.sql.execution.benchmark.AvroReadBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.BloomFilterBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.DataSourceReadBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.DateTimeBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.ExtractBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.FilterPushdownBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.InExpressionBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.IntervalBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.JoinBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.MakeDateTimeBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.MiscBenchmark'], | ||
['hive/test', 'org.apache.spark.sql.execution.benchmark.ObjectHashAggregateExecBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.OrcNestedSchemaPruningBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.OrcV2NestedSchemaPruningBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.ParquetNestedSchemaPruningBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.RangeBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.UDFBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.WideSchemaBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.benchmark.WideTableBenchmark'], | ||
['hive/test', 'org.apache.spark.sql.hive.orc.OrcReadBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.datasources.csv.CSVBenchmark'], | ||
['sql/test', 'org.apache.spark.sql.execution.datasources.json.JsonBenchmark'] | ||
] | ||
|
||
print('Set SPARK_GENERATE_BENCHMARK_FILES=1') | ||
os.environ['SPARK_GENERATE_BENCHMARK_FILES'] = '1' | ||
|
||
for b in benchmarks: | ||
print("Run benchmark: %s" % b[1]) | ||
run_cmd(['build/sbt', '%s:runMain %s' % (b[0], b[1])]) |
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.
Max, can we do
testOnly
or listing up files in some specific directories so we don't need to add here when we add a new benchmark if this targets to list up all benchmarks?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.
It does
runMain
of specific class. It is recommended way of running benchmarks, look at all benchmarks comments.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 don't like this automation because I usually run sub-set of benchmarks and for me it is easier to just comment unneeded benchmarks in the script.
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.
My use case is running some of benchmarks during night, let's say date-time related + parquet/orc. So, I don't need to run all of them because it can take a day to complete. I put other benchmarks (its project and class names) because I had already tested them in the PR #27078