Skip to content

Commit 8e60aa5

Browse files
authored
Merge pull request #6487 from natecook1000/nc-sort-benchmark
2 parents a744b45 + 95730e8 commit 8e60aa5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

benchmark/single-source/SortStrings.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,13 @@ public func run_SortStrings(_ N: Int) {
10301030
}
10311031
}
10321032

1033+
public func run_SortSortedStrings(_ N: Int) {
1034+
let sortedBenchmarkWords = stringBenchmarkWords.sorted()
1035+
for _ in 1...5*N {
1036+
benchSortStrings(sortedBenchmarkWords)
1037+
}
1038+
}
1039+
10331040
var stringBenchmarkWordsUnicode: [String] = [
10341041
"❄️woodshed",
10351042
"❄️lakism",

benchmark/utils/main.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ precommitTests = [
234234
"SevenBoom": run_SevenBoom,
235235
"Sim2DArray": run_Sim2DArray,
236236
"SortLettersInPlace": run_SortLettersInPlace,
237+
"SortSortedStrings": run_SortSortedStrings,
237238
"SortStrings": run_SortStrings,
238239
"SortStringsUnicode": run_SortStringsUnicode,
239240
"StackPromo": run_StackPromo,

0 commit comments

Comments
 (0)