@@ -17,15 +17,15 @@ public let QueueGeneric = BenchmarkInfo(
17
17
runFunction: run_QueueGeneric,
18
18
tags: [ . validation, . api] ,
19
19
setUpFunction: { buildWorkload ( ) } ,
20
- tearDownFunction : nil )
20
+ legacyFactor : 10 )
21
21
22
22
public let QueueConcrete = BenchmarkInfo (
23
23
name: " QueueConcrete " ,
24
24
runFunction: run_QueueConcrete,
25
25
tags: [ . validation, . api] ,
26
26
setUpFunction: { buildWorkload ( ) } ,
27
- tearDownFunction : nil )
28
-
27
+ legacyFactor : 10 )
28
+
29
29
// TODO: remove when there is a native equivalent in the std lib
30
30
extension RangeReplaceableCollection where Self: BidirectionalCollection {
31
31
public mutating func popLast( ) -> Element ? {
@@ -40,14 +40,14 @@ where Storage: BidirectionalCollection {
40
40
41
41
internal var _in : Storage
42
42
internal var _out : Storage
43
-
43
+
44
44
public init ( ) {
45
45
_in = Storage ( )
46
46
_out = Storage ( )
47
47
}
48
48
}
49
49
50
- extension Queue {
50
+ extension Queue {
51
51
public mutating func enqueue( _ newElement: Element ) {
52
52
_in. append ( newElement)
53
53
}
@@ -72,7 +72,7 @@ where Elements.Element: Equatable {
72
72
CheckResults ( j == elements. count*2)
73
73
}
74
74
75
- let n = 10_000
75
+ let n = 1_000
76
76
let workload = ( 0 ..< n) . map { " \( $0) : A long enough string to defeat the SSO, or so I hope. " }
77
77
78
78
public func buildWorkload( ) {
@@ -90,14 +90,14 @@ func run_QueueGeneric(_ scale: Int) {
90
90
public struct ConcreteQueue {
91
91
internal var _in : [ String ]
92
92
internal var _out : [ String ]
93
-
93
+
94
94
public init ( ) {
95
95
_in = Array ( )
96
96
_out = Array ( )
97
97
}
98
98
}
99
99
100
- extension ConcreteQueue {
100
+ extension ConcreteQueue {
101
101
public mutating func enqueue( _ newElement: String ) {
102
102
_in. append ( newElement)
103
103
}
@@ -128,4 +128,3 @@ func run_QueueConcrete(_ scale: Int) {
128
128
testConcreteQueue ( elements: workload)
129
129
}
130
130
}
131
-
0 commit comments