@@ -18,15 +18,15 @@ public let benchmarks = [
1818 BenchmarkInfo ( name: " NaiveRRC.append.largeContiguous " ,
1919 runFunction: runAppendLargeContiguous,
2020 tags: [ . validation, . api] ,
21- setUpFunction: { contiguous = [ UInt8] ( repeating: 7 , count: 10_000 ) } ) ,
21+ setUpFunction: { contiguous = [ UInt8] ( repeating: 7 , count: 1_000 ) } ) ,
2222 BenchmarkInfo ( name: " NaiveRRC.append.smallContiguousRepeatedly " ,
2323 runFunction: runAppendLargeContiguous,
2424 tags: [ . validation, . api] ,
2525 setUpFunction: { contiguous = [ UInt8] ( repeating: 7 , count: 1 ) } ) ,
2626 BenchmarkInfo ( name: " NaiveRRC.init.largeContiguous " ,
2727 runFunction: runInitLargeContiguous,
2828 tags: [ . validation, . api] ,
29- setUpFunction: { contiguous = [ UInt8] ( repeating: 7 , count: 10_000 ) } )
29+ setUpFunction: { contiguous = [ UInt8] ( repeating: 7 , count: 1_000 ) } )
3030]
3131
3232struct NaiveRRC : RangeReplaceableCollection {
@@ -78,7 +78,7 @@ public func runAppendLargeContiguous(N: Int) {
7878 for _ in 1 ... N {
7979 var rrc = NaiveRRC ( )
8080 rrc. append ( contentsOf: contiguous)
81- blackHole ( rrc. count + Int ( rrc [ 0 ] ) )
81+ blackHole ( rrc)
8282 }
8383}
8484
@@ -89,14 +89,14 @@ public func runAppendSmallContiguousRepeatedly(N: Int) {
8989 for _ in 1 ... 10_000_000 {
9090 rrc. append ( contentsOf: contiguous)
9191 }
92- blackHole ( rrc. count + Int ( rrc [ 0 ] ) )
92+ blackHole ( rrc)
9393 }
9494}
9595
9696@inline ( never)
9797public func runInitLargeContiguous( N: Int ) {
9898 for _ in 1 ... N {
9999 var rrc = NaiveRRC ( contiguous)
100- blackHole ( rrc. count + Int ( rrc [ 0 ] ) )
100+ blackHole ( rrc)
101101 }
102102}
0 commit comments