@@ -27,37 +27,43 @@ public let WordCount = [
27
27
name: " WordSplitASCII " ,
28
28
runFunction: run_WordSplitASCII,
29
29
tags: [ . validation, . api, . String, . algorithm, . unstable] ,
30
- setUpFunction: { buildWorkload ( ) }
30
+ setUpFunction: { buildWorkload ( ) } ,
31
+ legacyFactor: 10
31
32
) ,
32
33
BenchmarkInfo (
33
34
name: " WordSplitUTF16 " ,
34
35
runFunction: run_WordSplitUTF16,
35
36
tags: [ . validation, . api, . String, . algorithm, . unstable] ,
36
- setUpFunction: { buildWorkload ( ) }
37
+ setUpFunction: { buildWorkload ( ) } ,
38
+ legacyFactor: 10
37
39
) ,
38
40
BenchmarkInfo (
39
41
name: " WordCountUniqueASCII " ,
40
42
runFunction: run_WordCountUniqueASCII,
41
43
tags: [ . validation, . api, . String, . Dictionary, . algorithm] ,
42
- setUpFunction: { buildWorkload ( ) }
44
+ setUpFunction: { buildWorkload ( ) } ,
45
+ legacyFactor: 10
43
46
) ,
44
47
BenchmarkInfo (
45
48
name: " WordCountUniqueUTF16 " ,
46
49
runFunction: run_WordCountUniqueUTF16,
47
50
tags: [ . validation, . api, . String, . Dictionary, . algorithm] ,
48
- setUpFunction: { buildWorkload ( ) }
51
+ setUpFunction: { buildWorkload ( ) } ,
52
+ legacyFactor: 10
49
53
) ,
50
54
BenchmarkInfo (
51
55
name: " WordCountHistogramASCII " ,
52
56
runFunction: run_WordCountHistogramASCII,
53
57
tags: [ . validation, . api, . String, . Dictionary, . algorithm] ,
54
- setUpFunction: { buildWorkload ( ) }
58
+ setUpFunction: { buildWorkload ( ) } ,
59
+ legacyFactor: 100
55
60
) ,
56
61
BenchmarkInfo (
57
62
name: " WordCountHistogramUTF16 " ,
58
63
runFunction: run_WordCountHistogramUTF16,
59
64
tags: [ . validation, . api, . String, . Dictionary, . algorithm] ,
60
- setUpFunction: { buildWorkload ( ) }
65
+ setUpFunction: { buildWorkload ( ) } ,
66
+ legacyFactor: 100
61
67
) ,
62
68
]
63
69
@@ -201,7 +207,7 @@ struct Words: IteratorProtocol, Sequence {
201
207
202
208
@inline ( never)
203
209
public func run_WordSplitASCII( _ N: Int ) {
204
- for _ in 1 ... 10 * N {
210
+ for _ in 1 ... N {
205
211
let words = Array ( Words ( identity ( asciiText) ) )
206
212
CheckResults ( words. count == 280 )
207
213
blackHole ( words)
@@ -210,7 +216,7 @@ public func run_WordSplitASCII(_ N: Int) {
210
216
211
217
@inline ( never)
212
218
public func run_WordSplitUTF16( _ N: Int ) {
213
- for _ in 1 ... 10 * N {
219
+ for _ in 1 ... N {
214
220
let words = Array ( Words ( identity ( utf16Text) ) )
215
221
CheckResults ( words. count == 280 )
216
222
blackHole ( words)
@@ -222,7 +228,7 @@ let utf16Words = Array(Words(utf16Text))
222
228
223
229
@inline ( never)
224
230
public func run_WordCountUniqueASCII( _ N: Int ) {
225
- for _ in 1 ... 100 * N {
231
+ for _ in 1 ... 10 * N {
226
232
let words = Set ( identity ( asciiWords) )
227
233
CheckResults ( words. count == 168 )
228
234
blackHole ( words)
@@ -231,7 +237,7 @@ public func run_WordCountUniqueASCII(_ N: Int) {
231
237
232
238
@inline ( never)
233
239
public func run_WordCountUniqueUTF16( _ N: Int ) {
234
- for _ in 1 ... 100 * N {
240
+ for _ in 1 ... 10 * N {
235
241
let words = Set ( identity ( utf16Words) )
236
242
CheckResults ( words. count == 168 )
237
243
blackHole ( words)
@@ -252,7 +258,7 @@ where S.Element == String {
252
258
253
259
@inline ( never)
254
260
public func run_WordCountHistogramASCII( _ N: Int ) {
255
- for _ in 1 ... 100 * N {
261
+ for _ in 1 ... N {
256
262
let words = histogram ( for: identity ( asciiWords) )
257
263
CheckResults ( words. count == 168 )
258
264
CheckResults ( words [ 0 ] == ( " and " , 15 ) )
@@ -262,7 +268,7 @@ public func run_WordCountHistogramASCII(_ N: Int) {
262
268
263
269
@inline ( never)
264
270
public func run_WordCountHistogramUTF16( _ N: Int ) {
265
- for _ in 1 ... 100 * N {
271
+ for _ in 1 ... N {
266
272
let words = histogram ( for: identity ( utf16Words) )
267
273
CheckResults ( words. count == 168 )
268
274
CheckResults ( words [ 0 ] == ( " and " , 15 ) )
0 commit comments