mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Further benchmark scaling
This commit is contained in:
@@ -18,7 +18,7 @@ public let benchmarks = [
|
||||
BenchmarkInfo(name: "NaiveRRC.append.largeContiguous",
|
||||
runFunction: runAppendLargeContiguous,
|
||||
tags: [.validation, .api],
|
||||
setUpFunction: { contiguous = [UInt8](repeating: 7, count: 10_000) }),
|
||||
setUpFunction: { contiguous = [UInt8](repeating: 7, count: 1_000) }),
|
||||
BenchmarkInfo(name: "NaiveRRC.append.smallContiguousRepeatedly",
|
||||
runFunction: runAppendLargeContiguous,
|
||||
tags: [.validation, .api],
|
||||
@@ -26,7 +26,7 @@ public let benchmarks = [
|
||||
BenchmarkInfo(name: "NaiveRRC.init.largeContiguous",
|
||||
runFunction: runInitLargeContiguous,
|
||||
tags: [.validation, .api],
|
||||
setUpFunction: { contiguous = [UInt8](repeating: 7, count: 10_000) })
|
||||
setUpFunction: { contiguous = [UInt8](repeating: 7, count: 1_000) })
|
||||
]
|
||||
|
||||
struct NaiveRRC : RangeReplaceableCollection {
|
||||
@@ -78,7 +78,7 @@ public func runAppendLargeContiguous(N: Int) {
|
||||
for _ in 1...N {
|
||||
var rrc = NaiveRRC()
|
||||
rrc.append(contentsOf: contiguous)
|
||||
blackHole(rrc.count + Int(rrc[0]))
|
||||
blackHole(rrc)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public func runAppendSmallContiguousRepeatedly(N: Int) {
|
||||
for _ in 1...10_000_000 {
|
||||
rrc.append(contentsOf: contiguous)
|
||||
}
|
||||
blackHole(rrc.count + Int(rrc[0]))
|
||||
blackHole(rrc)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +97,6 @@ public func runAppendSmallContiguousRepeatedly(N: Int) {
|
||||
public func runInitLargeContiguous(N: Int) {
|
||||
for _ in 1...N {
|
||||
var rrc = NaiveRRC(contiguous)
|
||||
blackHole(rrc.count + Int(rrc[0]))
|
||||
blackHole(rrc)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user