-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tidy up benchmarks.jl, add option to select suites
Example of selecting a suite: ```julia benchmarkpkg(GCPDecompositions, BenchmarkConfig(;env=Dict("GCP_BENCHMARK_SUITES"=>"mttkrp"))) ``` Inspired by: https://github.com/JuliaCI/BaseBenchmarks.jl/blob/0ec1edace2d731de8d926f4b48a22cf2e5cc99c2/src/BaseBenchmarks.jl
- Loading branch information
Showing
3 changed files
with
21 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
using BenchmarkTools | ||
|
||
BenchmarkTools.DEFAULT_PARAMETERS.seconds = 1 | ||
# Default benchmark parameters | ||
BenchmarkTools.DEFAULT_PARAMETERS.seconds = 1.0 | ||
|
||
const SUITE = BenchmarkGroup() | ||
|
||
module BenchmarkGCP | ||
include("gcp.jl") | ||
end | ||
# Benchmark suite modules | ||
const SUITE_MODULES = Dict("gcp" => :BenchmarkGCP, "mttkrp" => :BenchmarkMTTKRP) | ||
const DEFAULT_SUITES = join(keys(SUITE_MODULES), ' ') | ||
|
||
module BenchmarkMTTKRP | ||
include("mttkrp.jl") | ||
# Create top-level suite including only sub-suites | ||
# specified by ENV variable "GCP_BENCHMARK_SUITES" | ||
const SUITE = BenchmarkGroup() | ||
SELECTED_SUITES = split(get(ENV, "GCP_BENCHMARK_SUITES", DEFAULT_SUITES)) | ||
for suite_name in SELECTED_SUITES | ||
module_name = SUITE_MODULES[suite_name] | ||
include(joinpath(@__DIR__, "$(suite_name).jl")) | ||
SUITE[suite_name] = eval(module_name).SUITE | ||
end | ||
|
||
SUITE["gcp"] = BenchmarkGCP.SUITE | ||
SUITE["mttkrp"] = BenchmarkMTTKRP.SUITE |
This file contains 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
This file contains 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