@@ -18,15 +18,15 @@ public let benchmarks = [
18
18
BenchmarkInfo ( name: " NaiveRRC.append.largeContiguous " ,
19
19
runFunction: runAppendLargeContiguous,
20
20
tags: [ . validation, . api] ,
21
- setUpFunction: { contiguous = [ UInt8] ( repeating: 7 , count: 10_000 ) } ) ,
21
+ setUpFunction: { contiguous = [ UInt8] ( repeating: 7 , count: 1_000 ) } ) ,
22
22
BenchmarkInfo ( name: " NaiveRRC.append.smallContiguousRepeatedly " ,
23
23
runFunction: runAppendLargeContiguous,
24
24
tags: [ . validation, . api] ,
25
25
setUpFunction: { contiguous = [ UInt8] ( repeating: 7 , count: 1 ) } ) ,
26
26
BenchmarkInfo ( name: " NaiveRRC.init.largeContiguous " ,
27
27
runFunction: runInitLargeContiguous,
28
28
tags: [ . validation, . api] ,
29
- setUpFunction: { contiguous = [ UInt8] ( repeating: 7 , count: 10_000 ) } )
29
+ setUpFunction: { contiguous = [ UInt8] ( repeating: 7 , count: 1_000 ) } )
30
30
]
31
31
32
32
struct NaiveRRC : RangeReplaceableCollection {
@@ -78,7 +78,7 @@ public func runAppendLargeContiguous(N: Int) {
78
78
for _ in 1 ... N {
79
79
var rrc = NaiveRRC ( )
80
80
rrc. append ( contentsOf: contiguous)
81
- blackHole ( rrc. count + Int ( rrc [ 0 ] ) )
81
+ blackHole ( rrc)
82
82
}
83
83
}
84
84
@@ -89,14 +89,14 @@ public func runAppendSmallContiguousRepeatedly(N: Int) {
89
89
for _ in 1 ... 10_000_000 {
90
90
rrc. append ( contentsOf: contiguous)
91
91
}
92
- blackHole ( rrc. count + Int ( rrc [ 0 ] ) )
92
+ blackHole ( rrc)
93
93
}
94
94
}
95
95
96
96
@inline ( never)
97
97
public func runInitLargeContiguous( N: Int ) {
98
98
for _ in 1 ... N {
99
99
var rrc = NaiveRRC ( contiguous)
100
- blackHole ( rrc. count + Int ( rrc [ 0 ] ) )
100
+ blackHole ( rrc)
101
101
}
102
102
}
0 commit comments