From a14dbd2fd067be528617fb88332d8433386d6b92 Mon Sep 17 00:00:00 2001 From: Nate Cook Date: Thu, 21 Aug 2025 09:23:29 -0500 Subject: [PATCH] Add and enable another large diffing benchmark (#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 #83212 is merged I will disable these large benchmarks again. --- benchmark/single-source/Diffing.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/benchmark/single-source/Diffing.swift b/benchmark/single-source/Diffing.swift index d6ee7991ea4..edc22c18499 100644 --- a/benchmark/single-source/Diffing.swift +++ b/benchmark/single-source/Diffing.swift @@ -50,10 +50,15 @@ public let benchmarks = [ tags: t, setUpFunction: { blackHole((unabridgedLorem, loremIpsum)) }), BenchmarkInfo( - name: "Diffing.VeryLarge", + name: "Diffing.Large.Similar", runFunction: { diff($0, from: bigUnabridgedLorem, to: bigLoremIpsum) }, - tags: t + [.skip], + tags: t, setUpFunction: { blackHole((bigUnabridgedLorem, bigLoremIpsum)) }), + BenchmarkInfo( + name: "Diffing.Large.Disparate", + runFunction: { diff($0, from: bigNumbersAndSymbols, to: bigAlphabets) }, + tags: t, + setUpFunction: { blackHole((bigNumbersAndSymbols, bigAlphabets)) }), ] let numbersAndSymbols = Array("0123456789`~!@#$%^&*()+=_-\"'?/<,>.\\{}'") @@ -66,6 +71,8 @@ let unabridgedLorem = Array("Lorem ipsum, quia dolor sit amet consectetur adipis let loremReversed = Array(loremIpsum.reversed()) let bigLoremIpsum = Array(repeatElement(loremIpsum, count: 100).joined()) let bigUnabridgedLorem = Array(repeatElement(unabridgedLorem, count: 100).joined()) +let bigNumbersAndSymbols = Array(repeatElement(numbersAndSymbols, count: 250).joined()) +let bigAlphabets = Array(repeatElement(alphabets, count: 250).joined()) @inline(never) func diff(_ n: Int, from older: [Character], to newer: [Character]) { if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {