mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Get rid of helper function
This commit is contained in:
@@ -27,39 +27,33 @@ public let benchmarks = [
|
|||||||
tags: [.validation, .api, .String])
|
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)
|
@inline(never)
|
||||||
public func run_singleAsciiCharacterCount100(N: Int) {
|
public func run_singleAsciiCharacterCount100(N: Int) {
|
||||||
|
let string = getString("x")
|
||||||
for _ in 1...5000*N {
|
for _ in 1...5000*N {
|
||||||
blackHole(repeating("x", count: 100))
|
blackHole(String(repeating: string, count: 100))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inline(never)
|
@inline(never)
|
||||||
public func run_26AsciiCharactersCount2(N: Int) {
|
public func run_26AsciiCharactersCount2(N: Int) {
|
||||||
|
let string = getString("abcdefghijklmnopqrstuvwxyz")
|
||||||
for _ in 1...5000*N {
|
for _ in 1...5000*N {
|
||||||
blackHole(repeating("abcdefghijklmnopqrstuvwxyz", count: 2))
|
blackHole(String(repeating: string, count: 2))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inline(never)
|
@inline(never)
|
||||||
public func run_33CyrillicCharactersCount2(N: Int) {
|
public func run_33CyrillicCharactersCount2(N: Int) {
|
||||||
|
let string = getString("абвгґдеєжзиіїйклмнопрстуфхцчшщьюя")
|
||||||
for _ in 1...5000*N {
|
for _ in 1...5000*N {
|
||||||
blackHole(repeating("абвгґдеєжзиіїйклмнопрстуфхцчшщьюя", count: 2))
|
blackHole(String(repeating: string, count: 2))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@inline(never)
|
@inline(never)
|
||||||
public func run_longMixedStringCount100(N: Int) {
|
public func run_longMixedStringCount100(N: Int) {
|
||||||
for _ in 1...5000*N {
|
let string = """
|
||||||
blackHole(
|
|
||||||
repeating(
|
|
||||||
"""
|
|
||||||
Swift is a multi-paradigm, compiled programming language created for
|
Swift is a multi-paradigm, compiled programming language created for
|
||||||
iOS, OS X, watchOS, tvOS and Linux development by Apple Inc. Swift is
|
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
|
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))
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user