Skip to content

Commit a14dbd2

Browse files
authored
Add and enable another large diffing benchmark (swiftlang#83832)
Enabling both of these despite the long runtime so that I can get an accurate measure of the change with the new diffing implementation. After swiftlang#83212 is merged I will disable these large benchmarks again.
1 parent a2effce commit a14dbd2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

benchmark/single-source/Diffing.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,15 @@ public let benchmarks = [
5050
tags: t,
5151
setUpFunction: { blackHole((unabridgedLorem, loremIpsum)) }),
5252
BenchmarkInfo(
53-
name: "Diffing.VeryLarge",
53+
name: "Diffing.Large.Similar",
5454
runFunction: { diff($0, from: bigUnabridgedLorem, to: bigLoremIpsum) },
55-
tags: t + [.skip],
55+
tags: t,
5656
setUpFunction: { blackHole((bigUnabridgedLorem, bigLoremIpsum)) }),
57+
BenchmarkInfo(
58+
name: "Diffing.Large.Disparate",
59+
runFunction: { diff($0, from: bigNumbersAndSymbols, to: bigAlphabets) },
60+
tags: t,
61+
setUpFunction: { blackHole((bigNumbersAndSymbols, bigAlphabets)) }),
5762
]
5863

5964
let numbersAndSymbols = Array("0123456789`~!@#$%^&*()+=_-\"'?/<,>.\\{}'")
@@ -66,6 +71,8 @@ let unabridgedLorem = Array("Lorem ipsum, quia dolor sit amet consectetur adipis
6671
let loremReversed = Array(loremIpsum.reversed())
6772
let bigLoremIpsum = Array(repeatElement(loremIpsum, count: 100).joined())
6873
let bigUnabridgedLorem = Array(repeatElement(unabridgedLorem, count: 100).joined())
74+
let bigNumbersAndSymbols = Array(repeatElement(numbersAndSymbols, count: 250).joined())
75+
let bigAlphabets = Array(repeatElement(alphabets, count: 250).joined())
6976

7077
@inline(never) func diff(_ n: Int, from older: [Character], to newer: [Character]) {
7178
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {

0 commit comments

Comments
 (0)