Skip to content

Commit 04af18a

Browse files
committed
Move performance tests to their own repository
1 parent 7991dcf commit 04af18a

7 files changed

Lines changed: 2 additions & 447 deletions

File tree

Package.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,10 @@ let package = Package(
55
name: "Differ",
66
products: [
77
.library(name: "Differ", targets: ["Differ"]),
8-
.executable(name: "PerformanceTester", targets: ["PerformanceTester"])
9-
],
10-
dependencies: [
11-
.package(url: "https://github.com/jflinter/Dwifft.git", from: "0.0.0")
128
],
139
targets: [
1410
.target(name: "Differ"),
1511
.testTarget(name: "DifferTests", dependencies: ["Differ"]),
16-
.target(name: "PerformanceTester", dependencies: ["Differ", "Dwifft"], exclude: ["Samples"])
1712
],
1813
swiftLanguageVersions: [4]
1914
)

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ If you'd like to learn more about how this library works, `Graph.playground` is
163163

164164
Differ is **fast**. Many of the other Swift diff libraries use a simple `O(n*m)` algorithm, which allocates a 2 dimensional array and then walks through every element. This can use _a lot_ of memory.
165165

166-
In the bundled benchmarks, you should see an order of magnitude difference in calculation time between the two algorithms.
166+
In the following benchmarks, you should see an order of magnitude difference in calculation time between the two algorithms.
167167

168168
Each measurement is the mean time in seconds it takes to calculate a diff, over 10 runs on an iPhone 6.
169169

@@ -174,11 +174,7 @@ Each measurement is the mean time in seconds it takes to calculate a diff, over
174174
| deleted | 0.0184 | 0.0050 |
175175
| diff | 0.1320 | 63.4084 |
176176

177-
You can run these benchmarks yourself:
178-
179-
```sh
180-
swift run -c release PerformanceTester Sources/PerformanceTester/Samples/Diff-old.swift Sources/PerformanceTester/Samples/Diff-new.swift
181-
```
177+
You can run these benchmarks yourself by [checking out the Diff Performance Suite](https://github.com/tonyarnold/DiffPerformanceSuite).
182178

183179
All of the above being said, the algorithm used by Diff works best for collections with _small_ differences between them. However, even for big differences this library is still likely to be faster than those that use the simple `O(n*m)` algorithm. If you need better performance with large differences between collections, please consider implementing a more suitable approach such as [Hunt & Szymanski's algorithm](http://par.cse.nsysu.edu.tw/~lcs/Hunt-Szymanski%20Algorithm.php) and/or [Hirschberg's algorithm](https://en.wikipedia.org/wiki/Hirschberg%27s_algorithm).
184180

Sources/PerformanceTester/Dwifft+Helpers.swift

Lines changed: 0 additions & 9 deletions
This file was deleted.

Sources/PerformanceTester/PerformanceTestUtils.swift

Lines changed: 0 additions & 61 deletions
This file was deleted.

Sources/PerformanceTester/Samples/Diff-new.swift

Lines changed: 0 additions & 174 deletions
This file was deleted.

0 commit comments

Comments
 (0)