mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Benchmarks: Skip long benchmarks in -Onone build
This commit is contained in:
@@ -363,6 +363,10 @@ function (swift_benchmark_compile_archopts)
|
||||
list(APPEND common_options "-g")
|
||||
endif()
|
||||
|
||||
if("${optflag}" STREQUAL "Onone")
|
||||
list(APPEND common_options "-DDEBUG")
|
||||
endif()
|
||||
|
||||
if (is_darwin)
|
||||
list(APPEND common_options
|
||||
"-I" "${srcdir}/utils/ObjectiveCTests"
|
||||
@@ -400,6 +404,10 @@ function (swift_benchmark_compile_archopts)
|
||||
"-target" "${target}"
|
||||
"-${driver_opt}")
|
||||
|
||||
if(${optflag} STREQUAL "Onone")
|
||||
list(APPEND common_options_driver "-DDEBUG")
|
||||
endif()
|
||||
|
||||
if(SWIFT_BENCHMARK_GENERATE_DEBUG_INFO)
|
||||
list(APPEND common_options_driver "-g")
|
||||
endif()
|
||||
|
||||
@@ -5,7 +5,7 @@ public let benchmarks = [
|
||||
BenchmarkInfo(
|
||||
name: "Monoids",
|
||||
runFunction: run_Monoids,
|
||||
tags: [.algorithm])
|
||||
tags: [.algorithm, .miniapplication, .long])
|
||||
]
|
||||
|
||||
func run_Monoids(_ n: Int) {
|
||||
|
||||
@@ -25,8 +25,15 @@ def perform_build(args, swiftbuild_path, config, binary_name, opt_flag):
|
||||
"-Xswiftc",
|
||||
"-align-module-to-page-size",
|
||||
"-Xswiftc",
|
||||
opt_flag,
|
||||
opt_flag
|
||||
]
|
||||
|
||||
if config == "debug":
|
||||
swiftbuild_args += [
|
||||
"-Xswiftc",
|
||||
"-DDEBUG"
|
||||
]
|
||||
|
||||
if args.verbose:
|
||||
swiftbuild_args.append("--verbose")
|
||||
subprocess.call(swiftbuild_args)
|
||||
|
||||
@@ -198,10 +198,16 @@ struct TestConfig {
|
||||
action = c.action ?? .run
|
||||
allowNondeterministicHashing = c.allowNondeterministicHashing ?? false
|
||||
jsonOutput = c.jsonOutput ?? false
|
||||
|
||||
var skipTags: Set<BenchmarkCategory>
|
||||
skipTags = c.tags ?? [.unstable, .skip]
|
||||
#if DEBUG
|
||||
skipTags.insert(.long)
|
||||
#endif
|
||||
tests = TestConfig.filterTests(registeredBenchmarks,
|
||||
tests: c.tests ?? [],
|
||||
tags: c.tags ?? [],
|
||||
skipTags: c.skipTags ?? [.unstable, .skip])
|
||||
skipTags: skipTags)
|
||||
|
||||
if tests.count > 0 {
|
||||
testNameLength = tests.map{$0.info.name.count}.sorted().reversed().first!
|
||||
|
||||
@@ -69,6 +69,9 @@ public enum BenchmarkCategory : String {
|
||||
// significant optimization.
|
||||
case cpubench
|
||||
|
||||
// Benchmarks to skip on -Onone runs.
|
||||
case long
|
||||
|
||||
// Explicit skip marker
|
||||
case skip
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user