12
12
import TestsUtils
13
13
14
14
public let StringTests = [
15
- BenchmarkInfo ( name: " StringEqualPointerComparison " , runFunction: run_StringEqualPointerComparison, tags: [ . validation, . api, . String] ) ,
16
- BenchmarkInfo ( name: " StringHasPrefixAscii " , runFunction: run_StringHasPrefixAscii, tags: [ . validation, . api, . String] ) ,
17
- BenchmarkInfo ( name: " StringHasPrefixUnicode " , runFunction: run_StringHasPrefixUnicode, tags: [ . validation, . api, . String] ) ,
18
- BenchmarkInfo ( name: " StringHasSuffixAscii " , runFunction: run_StringHasSuffixAscii, tags: [ . validation, . api, . String] ) ,
19
- BenchmarkInfo ( name: " StringHasSuffixUnicode " , runFunction: run_StringHasSuffixUnicode, tags: [ . validation, . api, . String] ) ,
15
+ BenchmarkInfo (
16
+ name: " StringEqualPointerComparison " ,
17
+ runFunction: run_StringEqualPointerComparison,
18
+ tags: [ . validation, . api, . String] ) ,
19
+ BenchmarkInfo (
20
+ name: " StringHasPrefixAscii " ,
21
+ runFunction: run_StringHasPrefixAscii,
22
+ tags: [ . validation, . api, . String] ,
23
+ legacyFactor: 10 ) ,
24
+ BenchmarkInfo (
25
+ name: " StringHasPrefixUnicode " ,
26
+ runFunction: run_StringHasPrefixUnicode,
27
+ tags: [ . validation, . api, . String] ,
28
+ legacyFactor: 1000 ) ,
29
+ BenchmarkInfo (
30
+ name: " StringHasSuffixAscii " ,
31
+ runFunction: run_StringHasSuffixAscii,
32
+ tags: [ . validation, . api, . String] ,
33
+ legacyFactor: 10 ) ,
34
+ BenchmarkInfo (
35
+ name: " StringHasSuffixUnicode " ,
36
+ runFunction: run_StringHasSuffixUnicode,
37
+ tags: [ . validation, . api, . String] ,
38
+ legacyFactor: 1000 ) ,
20
39
]
21
40
22
41
// FIXME(string)
@@ -25,7 +44,7 @@ public func run_StringHasPrefixAscii(_ N: Int) {
25
44
let prefix = " prefix "
26
45
let testString = " prefixedString "
27
46
for _ in 0 ..< N {
28
- for _ in 0 ..< 100_000 {
47
+ for _ in 0 ..< 10_000 {
29
48
CheckResults ( testString. hasPrefix ( getString ( prefix) ) )
30
49
}
31
50
}
@@ -38,7 +57,7 @@ public func run_StringHasSuffixAscii(_ N: Int) {
38
57
let suffix = " Suffixed "
39
58
let testString = " StringSuffixed "
40
59
for _ in 0 ..< N {
41
- for _ in 0 ..< 100_000 {
60
+ for _ in 0 ..< 10_000 {
42
61
CheckResults ( testString. hasSuffix ( getString ( suffix) ) )
43
62
}
44
63
}
@@ -51,7 +70,7 @@ public func run_StringHasPrefixUnicode(_ N: Int) {
51
70
let prefix = " ❄️prefix "
52
71
let testString = " ❄️prefixedString "
53
72
for _ in 0 ..< N {
54
- for _ in 0 ..< 100_000 {
73
+ for _ in 0 ..< 100 {
55
74
CheckResults ( testString. hasPrefix ( getString ( prefix) ) )
56
75
}
57
76
}
@@ -64,7 +83,7 @@ public func run_StringHasSuffixUnicode(_ N: Int) {
64
83
let suffix = " ❄️Suffixed "
65
84
let testString = " String❄️Suffixed "
66
85
for _ in 0 ..< N {
67
- for _ in 0 ..< 100_000 {
86
+ for _ in 0 ..< 100 {
68
87
CheckResults ( testString. hasSuffix ( getString ( suffix) ) )
69
88
}
70
89
}
0 commit comments