@@ -78,7 +78,7 @@ public let DataBenchmarks = [
78
78
runFunction: { append ( $0, arraySize: 809 , to: medium) } , tags: d) ,
79
79
80
80
BenchmarkInfo ( name: " DataReset " ,
81
- runFunction: run_Reset , tags: d) ,
81
+ runFunction: { resetBytes ( $0 , in : 431 ..< 809 , data : medium ) } , tags: d) ,
82
82
83
83
BenchmarkInfo ( name: " DataReplaceSmall " ,
84
84
runFunction: run_ReplaceSmall, tags: d) ,
@@ -241,10 +241,11 @@ func append(_ N: Int, sequenceLength: Int, to data: Data) {
241
241
}
242
242
}
243
243
244
- func benchmark_Reset( _ N: Int , _ range: Range < Data . Index > , _ data_: Data ) {
244
+ @inline ( never)
245
+ func resetBytes( _ N: Int , in range: Range < Data . Index > , data: Data ) {
245
246
for _ in 0 ..< 10000 * N {
246
- var data = data_
247
- data . resetBytes ( in: range)
247
+ var copy = data
248
+ copy . resetBytes ( in: range)
248
249
}
249
250
}
250
251
@@ -289,12 +290,6 @@ public func setCount(_ N: Int, data: Data, extra: Int) {
289
290
}
290
291
}
291
292
292
- @inline ( never)
293
- public func run_Reset( _ N: Int ) {
294
- let data = sampleData ( . medium)
295
- benchmark_Reset ( N, 431 ..< 809 , data)
296
- }
297
-
298
293
@inline ( never)
299
294
public func run_ReplaceSmall( _ N: Int ) {
300
295
let data = sampleData ( . medium)
0 commit comments