@@ -21,25 +21,34 @@ public let benchmarks = [
21
21
BenchmarkInfo (
22
22
name: " CxxVecU32.Sum.Cxx.RangedForLoop " ,
23
23
runFunction: run_CxxVectorOfU32_Sum_Cxx_RangedForLoop,
24
- tags: [ . validation, . bridging, . cxxInterop] ) ,
24
+ tags: [ . validation, . bridging, . cxxInterop] ,
25
+ setUpFunction: makeVectorOnce) ,
25
26
BenchmarkInfo (
26
27
name: " CxxVecU32.Sum.Swift.ForInLoop " ,
27
28
runFunction: run_CxxVectorOfU32_Sum_Swift_ForInLoop,
28
- tags: [ . validation, . bridging, . cxxInterop] ) ,
29
+ tags: [ . validation, . bridging, . cxxInterop] ,
30
+ setUpFunction: makeVectorOnce) ,
29
31
BenchmarkInfo (
30
32
name: " CxxVecU32.Sum.Swift.IteratorLoop " ,
31
33
runFunction: run_CxxVectorOfU32_Sum_Swift_RawIteratorLoop,
32
- tags: [ . validation, . bridging, . cxxInterop] ) ,
34
+ tags: [ . validation, . bridging, . cxxInterop] ,
35
+ setUpFunction: makeVectorOnce) ,
33
36
BenchmarkInfo (
34
37
name: " CxxVecU32.Sum.Swift.SubscriptLoop " ,
35
38
runFunction: run_CxxVectorOfU32_Sum_Swift_IndexAndSubscriptLoop,
36
- tags: [ . validation, . bridging, . cxxInterop] ) ,
39
+ tags: [ . validation, . bridging, . cxxInterop] ,
40
+ setUpFunction: makeVectorOnce) ,
37
41
BenchmarkInfo (
38
42
name: " CxxVecU32.Sum.Swift.Reduce " ,
39
43
runFunction: run_CxxVectorOfU32_Sum_Swift_Reduce,
40
- tags: [ . validation, . bridging, . cxxInterop] )
44
+ tags: [ . validation, . bridging, . cxxInterop] ,
45
+ setUpFunction: makeVectorOnce)
41
46
]
42
47
48
+ func makeVectorOnce( ) {
49
+ initVector ( vectorSize)
50
+ }
51
+
43
52
// FIXME: compare CxxVectorOfU32SumInCxx to CxxVectorOfU32SumInSwift and
44
53
// establish an expected threshold of performance, which when exceeded should
45
54
// fail the benchmark.
0 commit comments