benchmarks: disable some unstable benchmarks

and scale a substring test
This commit is contained in:
Erik Eckstein
2021-09-22 08:39:06 +02:00
parent 942b0e8a63
commit 5ff6308e05
4 changed files with 5 additions and 6 deletions

View File

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

View File

@@ -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",

View File

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

View File

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