Skip to content

Commit 5ff6308

Browse files
committed
benchmarks: disable some unstable benchmarks
and scale a substring test
1 parent 942b0e8 commit 5ff6308

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

benchmark/single-source/ArrayAppend.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import TestsUtils
1616

1717
let t: [BenchmarkCategory] = [.validation, .api, .Array]
1818
public let benchmarks = [
19-
BenchmarkInfo(name: "ArrayAppend", runFunction: run_ArrayAppend, tags: t, legacyFactor: 10),
19+
BenchmarkInfo(name: "ArrayAppend", runFunction: run_ArrayAppend, tags: t + [.unstable], legacyFactor: 10),
2020
BenchmarkInfo(name: "ArrayAppendArrayOfInt", runFunction: run_ArrayAppendArrayOfInt, tags: t,
2121
setUpFunction: ones, tearDownFunction: releaseOnes, legacyFactor: 10),
2222
BenchmarkInfo(name: "ArrayAppendAscii", runFunction: run_ArrayAppendAscii, tags: t, legacyFactor: 34),

benchmark/single-source/DataBenchmarks.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public let benchmarks = [
262262
runFunction: { append($0*50, data: large, to: medium) }, tags: d,
263263
legacyFactor: 200),
264264
BenchmarkInfo(name: "DataAppendDataLargeToLarge",
265-
runFunction: { append($0*50, data: large, to: large) }, tags: d,
265+
runFunction: { append($0*50, data: large, to: large) }, tags: d + [.unstable],
266266
legacyFactor: 200),
267267

268268
BenchmarkInfo(name: "DataToStringEmpty",

benchmark/single-source/Memset.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public let benchmarks =
1616
BenchmarkInfo(
1717
name: "Memset",
1818
runFunction: run_Memset,
19-
tags: [.validation])
19+
tags: [.validation, .unstable])
2020

2121
@inline(never)
2222
func memset(_ a: inout [Int], _ c: Int) {

benchmark/single-source/SubstringTest.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public let benchmarks = [
2727
setUpFunction: { blackHole(_comparison) }),
2828
BenchmarkInfo(name: "SubstringEqualString", runFunction: run_SubstringEqualString, tags: [.validation, .api, .String]),
2929
BenchmarkInfo(name: "SubstringEquatable", runFunction: run_SubstringEquatable, tags: [.validation, .api, .String]),
30-
BenchmarkInfo(name: "SubstringFromLongString", runFunction: run_SubstringFromLongString, tags: [.validation, .api, .String]),
30+
BenchmarkInfo(name: "SubstringFromLongString2", runFunction: run_SubstringFromLongString, tags: [.validation, .api, .String]),
3131
BenchmarkInfo(name: "SubstringFromLongStringGeneric", runFunction: run_SubstringFromLongStringGeneric, tags: [.validation, .api, .String]),
3232
BenchmarkInfo(name: "SubstringTrimmingASCIIWhitespace", runFunction: run_SubstringTrimmingASCIIWhitespace, tags: [.validation, .api, .String]),
3333
]
@@ -43,7 +43,7 @@ let quiteLong = String(repeating: "0", count: 10_000)[...]
4343
public func run_SubstringFromLongString(_ n: Int) {
4444
var s = longWide
4545
s += "!" // ensure the string has a real buffer
46-
for _ in 1...n*500 {
46+
for _ in 1...n*5000 {
4747
blackHole(Substring(s))
4848
}
4949
}
@@ -292,7 +292,6 @@ let _trimmableSubstrings = "pineapple,🍍, pineapple\t,\r\n\r\n\r\n, 🍍 ,".s
292292
@inline(never)
293293
public func run_SubstringTrimmingASCIIWhitespace(_ n: Int) {
294294
let substrings = _trimmableSubstrings // bringing this alias from above
295-
var count = 0
296295
for _ in 1...n*100 {
297296
for substring in substrings {
298297
blackHole(substring.trimWhitespace())

0 commit comments

Comments
 (0)