File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 13
13
// This benchmark tests creation and destruction of an array of enum
14
14
// and generic type bound to nontrivial types.
15
15
//
16
- // For comparison, we always create three arrays of 10 ,000 words.
16
+ // For comparison, we always create three arrays of 1 ,000 words.
17
17
18
18
import TestsUtils
19
19
20
20
public let ArrayOfGenericRef = BenchmarkInfo (
21
21
name: " ArrayOfGenericRef " ,
22
22
runFunction: run_ArrayOfGenericRef,
23
- tags: [ . validation, . api, . Array] )
23
+ tags: [ . validation, . api, . Array] ,
24
+ legacyFactor: 10 )
24
25
25
26
protocol Constructible {
26
27
associatedtype Element
@@ -31,8 +32,8 @@ class ConstructibleArray<T:Constructible> {
31
32
32
33
init ( _ e: T . Element ) {
33
34
array = [ T] ( )
34
- array. reserveCapacity ( 10_000 )
35
- for _ in 0 ... 10_000 {
35
+ array. reserveCapacity ( 1_000 )
36
+ for _ in 0 ... 1_000 {
36
37
array. append ( T ( e: e) as T )
37
38
}
38
39
}
@@ -65,7 +66,7 @@ func genCommonRefArray() {
65
66
class RefArray < T> {
66
67
var array : [ T ]
67
68
68
- init ( _ i: T , count: Int = 10_000 ) {
69
+ init ( _ i: T , count: Int = 1_000 ) {
69
70
array = [ T] ( repeating: i, count: count)
70
71
}
71
72
}
Original file line number Diff line number Diff line change 14
14
// references. It is meant to be a baseline for comparison against
15
15
// ArrayOfGenericRef.
16
16
//
17
- // For comparison, we always create four arrays of 10 ,000 words.
17
+ // For comparison, we always create four arrays of 1 ,000 words.
18
18
19
19
import TestsUtils
20
20
21
21
public let ArrayOfRef = BenchmarkInfo (
22
22
name: " ArrayOfRef " ,
23
23
runFunction: run_ArrayOfRef,
24
- tags: [ . validation, . api, . Array] )
24
+ tags: [ . validation, . api, . Array] ,
25
+ legacyFactor: 10 )
25
26
26
27
protocol Constructible {
27
28
associatedtype Element
@@ -32,8 +33,8 @@ class ConstructibleArray<T:Constructible> {
32
33
33
34
init ( _ e: T . Element ) {
34
35
array = [ T] ( )
35
- array. reserveCapacity ( 10_000 )
36
- for _ in 0 ... 10_000 {
36
+ array. reserveCapacity ( 1_000 )
37
+ for _ in 0 ... 1_000 {
37
38
array. append ( T ( e: e) as T )
38
39
}
39
40
}
@@ -77,7 +78,7 @@ enum RefEnum {
77
78
class RefArray < T> {
78
79
var array : [ T ]
79
80
80
- init ( _ i: T , count: Int = 10_000 ) {
81
+ init ( _ i: T , count: Int = 1_000 ) {
81
82
array = [ T] ( repeating: i, count: count)
82
83
}
83
84
}
You can’t perform that action at this time.
0 commit comments