Skip to content

Commit 345c6db

Browse files
authored
Merge pull request #21761 from milseman/super_char_ger
[benchmark] Rework SuperChars
2 parents cf3e40f + a30b774 commit 345c6db

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

benchmark/single-source/SuperChars.swift

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,16 @@
1414
import TestsUtils
1515

1616
public let SuperChars = BenchmarkInfo(
17-
name: "SuperChars",
17+
name: "SuperChars2",
1818
runFunction: run_SuperChars,
1919
tags: [.validation, .api, .String],
2020
setUpFunction: { blackHole(alphabetInput) })
2121

2222
// Permute some characters.
2323
let alphabetInput: [Character] = [
24-
"A", "B", "C", "D", "E", "F", "G",
25-
"«", // throw in some unicode to make it slower
26-
"H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
27-
"á", "",
28-
"S", "T", "U",
29-
"🇯🇵",
30-
"V", "W", "X", "Y", "Z", "/", "f", "Z", "z", "6", "7", "C", "j", "f", "9",
31-
"🇯🇵🇺🇸", "🇯🇵🇺🇸🇨🇳", "🇯🇵🇺🇸🇨🇳🇩🇪",
32-
"g", "g", "I", "J", "K", "c", "x", "i", ".",
33-
"🇯🇵🇺🇸🇨🇳🇩🇪", "🇯🇵🇺🇸", "🇯🇵🇺🇸🇨🇳",
34-
"2", "a", "t", "i", "o", "e", "q", "n", "X", "Y", "Z", "?", "m", "Z", ","
24+
"A", "B", "C", "D", "E", "F", "«",
25+
"á", "", "S", "T", "U", "🇯🇵",
26+
"🧟‍♀️", "👩‍👦‍👦", "🕴🏿", "2", "?",
3527
]
3628

3729
@inline(never)
@@ -43,7 +35,7 @@ public func run_SuperChars(_ N: Int) {
4335
for firstChar in alphabet {
4436
for middleChar in alphabet {
4537
for lastChar in alphabet {
46-
_ = ((firstChar == middleChar) != (middleChar < lastChar))
38+
blackHole((firstChar == middleChar) != (middleChar < lastChar))
4739
}
4840
}
4941
}

0 commit comments

Comments
 (0)