@@ -28,27 +28,33 @@ public let StringBuilder = [
28
28
BenchmarkInfo (
29
29
name: " StringUTF16Builder " ,
30
30
runFunction: run_StringUTF16Builder,
31
- tags: [ . validation, . api, . String] ) ,
31
+ tags: [ . validation, . api, . String] ,
32
+ legacyFactor: 10 ) ,
32
33
BenchmarkInfo (
33
34
name: " StringUTF16SubstringBuilder " ,
34
35
runFunction: run_StringUTF16SubstringBuilder,
35
- tags: [ . validation, . api, . String] ) ,
36
+ tags: [ . validation, . api, . String] ,
37
+ legacyFactor: 10 ) ,
36
38
BenchmarkInfo (
37
39
name: " StringBuilderLong " ,
38
40
runFunction: run_StringBuilderLong,
39
- tags: [ . validation, . api, . String] ) ,
41
+ tags: [ . validation, . api, . String] ,
42
+ legacyFactor: 10 ) ,
40
43
BenchmarkInfo (
41
44
name: " StringBuilderWithLongSubstring " ,
42
45
runFunction: run_StringBuilderWithLongSubstring,
43
- tags: [ . validation, . api, . String] ) ,
46
+ tags: [ . validation, . api, . String] ,
47
+ legacyFactor: 10 ) ,
44
48
BenchmarkInfo (
45
49
name: " StringWordBuilder " ,
46
50
runFunction: run_StringWordBuilder,
47
- tags: [ . validation, . api, . String] ) ,
51
+ tags: [ . validation, . api, . String] ,
52
+ legacyFactor: 10 ) ,
48
53
BenchmarkInfo (
49
54
name: " StringWordBuilderReservingCapacity " ,
50
55
runFunction: run_StringWordBuilderReservingCapacity,
51
- tags: [ . validation, . api, . String] ) ,
56
+ tags: [ . validation, . api, . String] ,
57
+ legacyFactor: 10 ) ,
52
58
]
53
59
54
60
@inline ( never)
@@ -110,14 +116,14 @@ func buildStringFromSmallSubstrings(_ i: String) -> String {
110
116
111
117
@inline ( never)
112
118
public func run_StringUTF16Builder( _ N: Int ) {
113
- for _ in 1 ... 5000 * N {
119
+ for _ in 1 ... 500 * N {
114
120
blackHole ( buildStringUTF16 ( " a " ) )
115
121
}
116
122
}
117
123
118
124
@inline ( never)
119
125
public func run_StringUTF16SubstringBuilder( _ N: Int ) {
120
- for _ in 1 ... 5000 * N {
126
+ for _ in 1 ... 500 * N {
121
127
blackHole ( buildStringFromSmallSubstrings ( " a " ) )
122
128
}
123
129
}
@@ -153,14 +159,14 @@ func buildStringWithLongSubstring(_ i: String) -> String {
153
159
154
160
@inline ( never)
155
161
public func run_StringBuilderLong( _ N: Int ) {
156
- for _ in 1 ... 5000 * N {
162
+ for _ in 1 ... 500 * N {
157
163
blackHole ( buildStringLong ( " 👻 " ) )
158
164
}
159
165
}
160
166
161
167
@inline ( never)
162
168
public func run_StringBuilderWithLongSubstring( _ N: Int ) {
163
- for _ in 1 ... 5000 * N {
169
+ for _ in 1 ... 500 * N {
164
170
blackHole ( buildStringWithLongSubstring ( " 👻 " ) )
165
171
}
166
172
}
@@ -184,13 +190,16 @@ func buildString(
184
190
185
191
@inline ( never)
186
192
public func run_StringWordBuilder( _ N: Int ) {
187
- blackHole ( buildString (
188
- word: " bumfuzzle " , count: 50_000 * N, reservingCapacity: false ) )
193
+ for _ in 1 ... N {
194
+ blackHole ( buildString (
195
+ word: " bumfuzzle " , count: 5_000 , reservingCapacity: false ) )
196
+ }
189
197
}
190
198
191
199
@inline ( never)
192
200
public func run_StringWordBuilderReservingCapacity( _ N: Int ) {
193
- blackHole ( buildString (
194
- word: " bumfuzzle " , count: 50_000 * N, reservingCapacity: true ) )
201
+ for _ in 1 ... N {
202
+ blackHole ( buildString (
203
+ word: " bumfuzzle " , count: 5_000 , reservingCapacity: true ) )
204
+ }
195
205
}
196
-
0 commit comments