Get rid of helper function

This commit is contained in:
Valeriy Van
2023-02-28 10:30:33 +02:00
parent da5be81857
commit e59a74dd41

View File

@@ -27,39 +27,33 @@ public let benchmarks = [
tags: [.validation, .api, .String])
]
@inline(never)
func repeating(_ i: String, count: Int) -> String {
let s = String(repeating: getString(i), count: count)
return s
}
@inline(never)
public func run_singleAsciiCharacterCount100(N: Int) {
let string = getString("x")
for _ in 1...5000*N {
blackHole(repeating("x", count: 100))
blackHole(String(repeating: string, count: 100))
}
}
@inline(never)
public func run_26AsciiCharactersCount2(N: Int) {
let string = getString("abcdefghijklmnopqrstuvwxyz")
for _ in 1...5000*N {
blackHole(repeating("abcdefghijklmnopqrstuvwxyz", count: 2))
blackHole(String(repeating: string, count: 2))
}
}
@inline(never)
public func run_33CyrillicCharactersCount2(N: Int) {
let string = getString("абвгґдеєжзиіїйклмнопрстуфхцчшщьюя")
for _ in 1...5000*N {
blackHole(repeating("абвгґдеєжзиіїйклмнопрстуфхцчшщьюя", count: 2))
blackHole(String(repeating: string, count: 2))
}
}
@inline(never)
public func run_longMixedStringCount100(N: Int) {
for _ in 1...5000*N {
blackHole(
repeating(
"""
let string = """
Swift is a multi-paradigm, compiled programming language created for
iOS, OS X, watchOS, tvOS and Linux development by Apple Inc. Swift is
designed to work with Apple's Cocoa and Cocoa Touch frameworks and the
@@ -75,9 +69,8 @@ public func run_longMixedStringCount100(N: Int) {
日本語の場合はランダムに生成された文章以外に、
著作権が切れた小説などが利用されることもある。
🦩
""",
count: 100
)
)
"""
for _ in 1...5000*N {
blackHole(String(repeating: string, count: 100))
}
}