Benchmarks: Skip long benchmarks in -Onone build

This commit is contained in:
Slava Pestov
2025-08-26 16:15:37 -04:00
parent 694274204b
commit 2ec19ecb46
5 changed files with 27 additions and 3 deletions

View File

@@ -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()

View File

@@ -5,7 +5,7 @@ public let benchmarks = [
BenchmarkInfo(
name: "Monoids",
runFunction: run_Monoids,
tags: [.algorithm])
tags: [.algorithm, .miniapplication, .long])
]
func run_Monoids(_ n: Int) {

View File

@@ -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)

View File

@@ -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!

View File

@@ -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
}