Further benchmark scaling

This commit is contained in:
David Smith
2023-05-10 01:25:38 -07:00
parent 71ed988d27
commit 0ddc90b355

View File

@@ -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)
}
}