Skip to content

Commit 1dd9d61

Browse files
author
Max Moiseev
committed
Move all benchmarks to use registerBenchmark and BenchmarkInfo
1 parent 86eeb54 commit 1dd9d61

File tree

107 files changed

+1663
-553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1663
-553
lines changed

benchmark/multi-source/PrimsSplit/main.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313
import TestsUtils
1414

15+
public let PrimsSplit = BenchmarkInfo(
16+
name: "PrimsSplit",
17+
runFunction: run_PrimsSplit,
18+
tags: [.validation, .algorithm])
19+
1520
@inline(never)
1621
public func run_PrimsSplit(_ N: Int) {
1722
for _ in 1...5*N {

benchmark/single-source/Ackermann.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
// for performance measuring.
1515
import TestsUtils
1616

17+
public let Ackermann = BenchmarkInfo(
18+
name: "Ackermann",
19+
runFunction: run_Ackermann,
20+
tags: [.unstable, .algorithm])
21+
1722
func ackermann(_ M: Int, _ N : Int) -> Int {
1823
if (M == 0) { return N + 1 }
1924
if (N == 0) { return ackermann(M - 1, 1) }

benchmark/single-source/AngryPhonebook.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
import TestsUtils
1616
import Foundation
1717

18+
public let AngryPhonebook = BenchmarkInfo(
19+
name: "AngryPhonebook",
20+
runFunction: run_AngryPhonebook,
21+
tags: [.validation, .api, .String])
22+
1823
var words = [
1924
"James", "John", "Robert", "Michael", "William", "David", "Richard", "Joseph",
2025
"Charles", "Thomas", "Christopher", "Daniel", "Matthew", "Donald", "Anthony",

benchmark/single-source/Array2D.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import TestsUtils
14+
15+
public let Array2D = BenchmarkInfo(
16+
name: "Array2D",
17+
runFunction: run_Array2D,
18+
tags: [.validation, .api, .Array])
19+
1320
@inline(never)
1421
public func run_Array2D(_ N: Int) {
1522
var A: [[Int]] = []

benchmark/single-source/ArrayAppend.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,28 @@
1414

1515
import TestsUtils
1616

17+
public let ArrayAppend = [
18+
BenchmarkInfo(name: "ArrayAppend", runFunction: run_ArrayAppend, tags: [.validation, .api, .Array]),
19+
BenchmarkInfo(name: "ArrayAppendArrayOfInt", runFunction: run_ArrayAppendArrayOfInt, tags: [.validation, .api, .Array]),
20+
BenchmarkInfo(name: "ArrayAppendAscii", runFunction: run_ArrayAppendAscii, tags: [.validation, .api, .Array]),
21+
BenchmarkInfo(name: "ArrayAppendFromGeneric", runFunction: run_ArrayAppendFromGeneric, tags: [.validation, .api, .Array]),
22+
BenchmarkInfo(name: "ArrayAppendGenericStructs", runFunction: run_ArrayAppendGenericStructs, tags: [.validation, .api, .Array]),
23+
BenchmarkInfo(name: "ArrayAppendLatin1", runFunction: run_ArrayAppendLatin1, tags: [.validation, .api, .Array]),
24+
BenchmarkInfo(name: "ArrayAppendLazyMap", runFunction: run_ArrayAppendLazyMap, tags: [.validation, .api, .Array]),
25+
BenchmarkInfo(name: "ArrayAppendOptionals", runFunction: run_ArrayAppendOptionals, tags: [.validation, .api, .Array]),
26+
BenchmarkInfo(name: "ArrayAppendRepeatCol", runFunction: run_ArrayAppendRepeatCol, tags: [.validation, .api, .Array]),
27+
BenchmarkInfo(name: "ArrayAppendReserved", runFunction: run_ArrayAppendReserved, tags: [.validation, .api, .Array]),
28+
BenchmarkInfo(name: "ArrayAppendSequence", runFunction: run_ArrayAppendSequence, tags: [.validation, .api, .Array]),
29+
BenchmarkInfo(name: "ArrayAppendStrings", runFunction: run_ArrayAppendStrings, tags: [.validation, .api, .Array]),
30+
BenchmarkInfo(name: "ArrayAppendToFromGeneric", runFunction: run_ArrayAppendToFromGeneric, tags: [.validation, .api, .Array]),
31+
BenchmarkInfo(name: "ArrayAppendToGeneric", runFunction: run_ArrayAppendToGeneric, tags: [.validation, .api, .Array]),
32+
BenchmarkInfo(name: "ArrayAppendUTF16", runFunction: run_ArrayAppendUTF16, tags: [.validation, .api, .Array]),
33+
BenchmarkInfo(name: "ArrayPlusEqualArrayOfInt", runFunction: run_ArrayPlusEqualArrayOfInt, tags: [.validation, .api, .Array]),
34+
BenchmarkInfo(name: "ArrayPlusEqualFiveElementCollection", runFunction: run_ArrayPlusEqualFiveElementCollection, tags: [.validation, .api, .Array]),
35+
BenchmarkInfo(name: "ArrayPlusEqualSingleElementCollection", runFunction: run_ArrayPlusEqualSingleElementCollection, tags: [.validation, .api, .Array]),
36+
BenchmarkInfo(name: "ArrayPlusEqualThreeElements", runFunction: run_ArrayPlusEqualThreeElements, tags: [.validation, .api, .Array]),
37+
]
38+
1739
// Append single element
1840
@inline(never)
1941
public func run_ArrayAppend(_ N: Int) {

benchmark/single-source/ArrayInClass.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import TestsUtils
14+
public let ArrayInClass = BenchmarkInfo(
15+
name: "ArrayInClass",
16+
runFunction: run_ArrayInClass,
17+
tags: [.validation, .api, .Array])
18+
1319
class ArrayContainer {
1420
final var arr : [Int]
1521

benchmark/single-source/ArrayLiteral.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
// It is reported to be slow: <rdar://problem/17297449>
1616
import TestsUtils
1717

18+
public let ArrayLiteral = [
19+
BenchmarkInfo(name: "ArrayLiteral", runFunction: run_ArrayLiteral, tags: [.validation, .api, .Array]),
20+
BenchmarkInfo(name: "ArrayValueProp", runFunction: run_ArrayValueProp, tags: [.validation, .api, .Array]),
21+
BenchmarkInfo(name: "ArrayValueProp2", runFunction: run_ArrayValueProp2, tags: [.validation, .api, .Array]),
22+
BenchmarkInfo(name: "ArrayValueProp3", runFunction: run_ArrayValueProp3, tags: [.validation, .api, .Array]),
23+
BenchmarkInfo(name: "ArrayValueProp4", runFunction: run_ArrayValueProp4, tags: [.validation, .api, .Array]),
24+
]
25+
1826
@inline(never)
1927
func makeArray() -> [Int] {
2028
return [1,2,3]

benchmark/single-source/ArrayOfGenericPOD.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
// For comparison, we always create three arrays of 200,000 words.
1919
// An integer enum takes two words.
2020

21+
import TestsUtils
22+
23+
public let ArrayOfGenericPOD = BenchmarkInfo(
24+
name: "ArrayOfGenericPOD",
25+
runFunction: run_ArrayOfGenericPOD,
26+
tags: [.validation, .api, .Array])
27+
2128
class RefArray<T> {
2229
var array: [T]
2330

benchmark/single-source/ArrayOfGenericRef.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
//
1616
// For comparison, we always create three arrays of 10,000 words.
1717

18+
import TestsUtils
19+
20+
public let ArrayOfGenericRef = BenchmarkInfo(
21+
name: "ArrayOfGenericRef",
22+
runFunction: run_ArrayOfGenericRef,
23+
tags: [.validation, .api, .Array])
24+
1825
protocol Constructible {
1926
associatedtype Element
2027
init(e:Element)

benchmark/single-source/ArrayOfPOD.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
//
1717
// For comparison, we always create three arrays of 200,000 words.
1818

19+
import TestsUtils
20+
21+
public let ArrayOfPOD = BenchmarkInfo(
22+
name: "ArrayOfPOD",
23+
runFunction: run_ArrayOfPOD,
24+
tags: [.validation, .api, .Array])
25+
1926
class RefArray<T> {
2027
var array : [T]
2128

0 commit comments

Comments
 (0)