@@ -30,6 +30,10 @@ public let benchmarks = [
30
30
name: " CxxVectorOfU32.Sum.Swift.RawIteratorLoop " ,
31
31
runFunction: run_CxxVectorOfU32_Sum_Swift_RawIteratorLoop,
32
32
tags: [ . validation, . bridging, . cxxInterop] ) ,
33
+ BenchmarkInfo (
34
+ name: " CxxVectorOfU32.Sum.Swift.RawIteratorLoop.WithCxxInlineHelpers " ,
35
+ runFunction: run_CxxVectorOfU32_Sum_Swift_RawIteratorLoop_WithCxxInlineHelpers,
36
+ tags: [ . validation, . bridging, . cxxInterop] ) ,
33
37
BenchmarkInfo (
34
38
name: " CxxVectorOfU32.Sum.Swift.IndexAndSubscriptLoop " ,
35
39
runFunction: run_CxxVectorOfU32_Sum_Swift_IndexAndSubscriptLoop,
@@ -68,7 +72,7 @@ public func run_CxxVectorOfU32_Sum_Swift_ForInLoop(_ n: Int) {
68
72
// This function should have comparable performance to
69
73
// `run_CxxVectorOfU32_Sum_Cxx_RangedForLoop`.
70
74
@inline ( never)
71
- public func run_CxxVectorOfU32_Sum_Swift_RawIteratorLoop ( _ n: Int ) {
75
+ public func run_CxxVectorOfU32_Sum_Swift_RawIteratorLoop_WithCxxInlineHelpers ( _ n: Int ) {
72
76
let vectorOfU32 = makeVector32 ( vectorSize)
73
77
var sum : UInt32 = 0
74
78
for _ in 0 ..< ( n * iterRepeatFactor) {
@@ -82,6 +86,23 @@ public func run_CxxVectorOfU32_Sum_Swift_RawIteratorLoop(_ n: Int) {
82
86
blackHole ( sum)
83
87
}
84
88
89
+ // This function should have comparable performance to
90
+ // `run_CxxVectorOfU32_Sum_Cxx_RangedForLoop`.
91
+ @inline ( never)
92
+ public func run_CxxVectorOfU32_Sum_Swift_RawIteratorLoop( _ n: Int ) {
93
+ let vectorOfU32 = makeVector32 ( vectorSize)
94
+ var sum : UInt32 = 0
95
+ for _ in 0 ..< ( n * iterRepeatFactor) {
96
+ var b = vectorOfU32. __beginUnsafe ( )
97
+ let e = vectorOfU32. __endUnsafe ( )
98
+ while b != e {
99
+ sum = sum &+ b. pointee
100
+ b = b. successor ( )
101
+ }
102
+ }
103
+ blackHole ( sum)
104
+ }
105
+
85
106
@inline ( never)
86
107
public func run_CxxVectorOfU32_Sum_Swift_IndexAndSubscriptLoop( _ n: Int ) {
87
108
let vectorOfU32 = makeVector32 ( vectorSize)
0 commit comments