mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
benchmarks: disable some unstable benchmarks
and scale a substring test
This commit is contained in:
@@ -16,7 +16,7 @@ import TestsUtils
|
||||
|
||||
let t: [BenchmarkCategory] = [.validation, .api, .Array]
|
||||
public let benchmarks = [
|
||||
BenchmarkInfo(name: "ArrayAppend", runFunction: run_ArrayAppend, tags: t, legacyFactor: 10),
|
||||
BenchmarkInfo(name: "ArrayAppend", runFunction: run_ArrayAppend, tags: t + [.unstable], legacyFactor: 10),
|
||||
BenchmarkInfo(name: "ArrayAppendArrayOfInt", runFunction: run_ArrayAppendArrayOfInt, tags: t,
|
||||
setUpFunction: ones, tearDownFunction: releaseOnes, legacyFactor: 10),
|
||||
BenchmarkInfo(name: "ArrayAppendAscii", runFunction: run_ArrayAppendAscii, tags: t, legacyFactor: 34),
|
||||
|
||||
@@ -262,7 +262,7 @@ public let benchmarks = [
|
||||
runFunction: { append($0*50, data: large, to: medium) }, tags: d,
|
||||
legacyFactor: 200),
|
||||
BenchmarkInfo(name: "DataAppendDataLargeToLarge",
|
||||
runFunction: { append($0*50, data: large, to: large) }, tags: d,
|
||||
runFunction: { append($0*50, data: large, to: large) }, tags: d + [.unstable],
|
||||
legacyFactor: 200),
|
||||
|
||||
BenchmarkInfo(name: "DataToStringEmpty",
|
||||
|
||||
@@ -16,7 +16,7 @@ public let benchmarks =
|
||||
BenchmarkInfo(
|
||||
name: "Memset",
|
||||
runFunction: run_Memset,
|
||||
tags: [.validation])
|
||||
tags: [.validation, .unstable])
|
||||
|
||||
@inline(never)
|
||||
func memset(_ a: inout [Int], _ c: Int) {
|
||||
|
||||
@@ -27,7 +27,7 @@ public let benchmarks = [
|
||||
setUpFunction: { blackHole(_comparison) }),
|
||||
BenchmarkInfo(name: "SubstringEqualString", runFunction: run_SubstringEqualString, tags: [.validation, .api, .String]),
|
||||
BenchmarkInfo(name: "SubstringEquatable", runFunction: run_SubstringEquatable, tags: [.validation, .api, .String]),
|
||||
BenchmarkInfo(name: "SubstringFromLongString", runFunction: run_SubstringFromLongString, tags: [.validation, .api, .String]),
|
||||
BenchmarkInfo(name: "SubstringFromLongString2", runFunction: run_SubstringFromLongString, tags: [.validation, .api, .String]),
|
||||
BenchmarkInfo(name: "SubstringFromLongStringGeneric", runFunction: run_SubstringFromLongStringGeneric, tags: [.validation, .api, .String]),
|
||||
BenchmarkInfo(name: "SubstringTrimmingASCIIWhitespace", runFunction: run_SubstringTrimmingASCIIWhitespace, tags: [.validation, .api, .String]),
|
||||
]
|
||||
@@ -43,7 +43,7 @@ let quiteLong = String(repeating: "0", count: 10_000)[...]
|
||||
public func run_SubstringFromLongString(_ n: Int) {
|
||||
var s = longWide
|
||||
s += "!" // ensure the string has a real buffer
|
||||
for _ in 1...n*500 {
|
||||
for _ in 1...n*5000 {
|
||||
blackHole(Substring(s))
|
||||
}
|
||||
}
|
||||
@@ -292,7 +292,6 @@ let _trimmableSubstrings = "pineapple,🍍, pineapple\t,\r\n\r\n\r\n, 🍍 ,".s
|
||||
@inline(never)
|
||||
public func run_SubstringTrimmingASCIIWhitespace(_ n: Int) {
|
||||
let substrings = _trimmableSubstrings // bringing this alias from above
|
||||
var count = 0
|
||||
for _ in 1...n*100 {
|
||||
for substring in substrings {
|
||||
blackHole(substring.trimWhitespace())
|
||||
|
||||
Reference in New Issue
Block a user