Content-Length: 461569 | pFad | http://github.com/davecom/SwiftGraph/commit/82a5b024bfda597683dfe0e24c523191cacc597c

7B Add Union performance tests · davecom/SwiftGraph@82a5b02 · GitHub
Skip to content

Commit 82a5b02

Browse files
Add Union performance tests
1 parent 5ba6c3f commit 82a5b02

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

SwiftGraph.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
B5EF143321791348008FCC5C /* UniqueElementsGraphHashableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5EF143221791348008FCC5C /* UniqueElementsGraphHashableTests.swift */; };
5050
B5EF1437217913F1008FCC5C /* EquatableTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5EF1436217913F1008FCC5C /* EquatableTypes.swift */; };
5151
B5F07B6B222EB43000824F08 /* ArraysHaveSameElements.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F07B6A222EB43000824F08 /* ArraysHaveSameElements.swift */; };
52+
B5FE1C212231DA0C008BACAA /* UnionPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5FE1C202231DA0C008BACAA /* UnionPerformanceTests.swift */; };
5253
/* End PBXBuildFile section */
5354

5455
/* Begin PBXContainerItemProxy section */
@@ -135,6 +136,7 @@
135136
B5EF143221791348008FCC5C /* UniqueElementsGraphHashableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UniqueElementsGraphHashableTests.swift; sourceTree = "<group>"; };
136137
B5EF1436217913F1008FCC5C /* EquatableTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EquatableTypes.swift; sourceTree = "<group>"; };
137138
B5F07B6A222EB43000824F08 /* ArraysHaveSameElements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArraysHaveSameElements.swift; sourceTree = "<group>"; };
139+
B5FE1C202231DA0C008BACAA /* UnionPerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnionPerformanceTests.swift; sourceTree = "<group>"; };
138140
/* End PBXFileReference section */
139141

140142
/* Begin PBXFrameworksBuildPhase section */
@@ -318,6 +320,7 @@
318320
children = (
319321
B5DD6DA42171EEE1007EFF44 /* SearchPerformanceTests.swift */,
320322
B5D022B0217357480079F17C /* ConstructorsPerformanceTests.swift */,
323+
B5FE1C202231DA0C008BACAA /* UnionPerformanceTests.swift */,
321324
);
322325
name = SwiftGraphPerformanceTests;
323326
path = Tests/SwiftGraphPerformanceTests;
@@ -560,6 +563,7 @@
560563
buildActionMask = 2147483647;
561564
files = (
562565
B5EACB292172336900E527BD /* SearchPerformanceTests.swift in Sources */,
566+
B5FE1C212231DA0C008BACAA /* UnionPerformanceTests.swift in Sources */,
563567
B5D022B1217357480079F17C /* ConstructorsPerformanceTests.swift in Sources */,
564568
);
565569
runOnlyForDeploymentPostprocessing = 0;

SwiftGraph.xcodeproj/xcshareddata/xcbaselines/B5EACB0A2172315E00E527BD.xcbaseline/94D648AC-76B2-4B8F-A1FF-3A34FAC1AF9B.plist

+23
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,29 @@
330330
</dict>
331331
</dict>
332332
</dict>
333+
<key>UnionTests</key>
334+
<dict>
335+
<key>testDisjointUnion()</key>
336+
<dict>
337+
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
338+
<dict>
339+
<key>baselineAverage</key>
340+
<real>2.0054</real>
341+
<key>baselineIntegrationDisplayName</key>
342+
<string>Local Baseline</string>
343+
</dict>
344+
</dict>
345+
<key>testUnionWithSelf()</key>
346+
<dict>
347+
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
348+
<dict>
349+
<key>baselineAverage</key>
350+
<real>2.0124</real>
351+
<key>baselineIntegrationDisplayName</key>
352+
<string>Local Baseline</string>
353+
</dict>
354+
</dict>
355+
</dict>
333356
</dict>
334357
</dict>
335358
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// UnionPerformanceTests.swift
3+
// SwiftGraphTests
4+
//
5+
// Copyright (c) 2018 Ferran Pujol Camins
6+
//
7+
// Licensed under the Apache License, Version 2.0 (the "License");
8+
// you may not use this file except in compliance with the License.
9+
// You may obtain a copy of the License at
10+
//
11+
// http://www.apache.org/licenses/LICENSE-2.0
12+
//
13+
// Unless required by applicable law or agreed to in writing, software
14+
// distributed under the License is distributed on an "AS IS" BASIS,
15+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
// See the License for the specific language governing permissions and
17+
// limitations under the License.
18+
import XCTest
19+
@testable import SwiftGraph
20+
21+
class UnionTests: XCTestCase {
22+
23+
func testDisjointUnion() {
24+
let g1 = UniqueElementsGraph<Int>(withPath: Array(1...999))
25+
let g2 = UniqueElementsGraph<Int>(withPath: Array(1000...1999))
26+
self.measure {
27+
_ = UniqueElementsGraph<Int>(unionOf: g1, g2)
28+
}
29+
}
30+
31+
func testUnionWithSelf() {
32+
let g = UniqueElementsGraph<Int>(withPath: Array(1...999))
33+
self.measure {
34+
_ = UniqueElementsGraph<Int>(unionOf: g, g, g, g)
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/davecom/SwiftGraph/commit/82a5b024bfda597683dfe0e24c523191cacc597c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy