From f95b2baa184daec6517ad4531e742acc427911f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bardon?= Date: Sun, 27 Nov 2022 23:04:47 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20WIP=20Create=20binary=20size=20b?= =?UTF-8?q?enchmarks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SwiftGeoBinarySizeBenchmark/.gitignore | 9 ++++++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++++ .../Package.resolved | 31 +++++++++++++++++++ .../SwiftGeoBinarySizeBenchmark/Package.swift | 24 ++++++++++++++ .../SwiftGeoBinarySizeBenchmark/README.md | 1 + .../SwiftGeoBinarySizeBenchmark1/main.swift | 8 +++++ .../SwiftGeoBinarySizeBenchmark1/.gitignore | 9 ++++++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++++ .../Package.swift | 28 +++++++++++++++++ .../SwiftGeoBinarySizeBenchmark1/README.md | 3 ++ .../SwiftGeoBinarySizeBenchmark1.swift | 6 ++++ .../SwiftGeoBinarySizeBenchmark1Tests.swift | 11 +++++++ 12 files changed, 146 insertions(+) create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark/.gitignore create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark/Package.resolved create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark/Package.swift create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark/README.md create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark/Sources/SwiftGeoBinarySizeBenchmark1/main.swift create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark1/.gitignore create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark1/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark1/Package.swift create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark1/README.md create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark1/Sources/SwiftGeoBinarySizeBenchmark1/SwiftGeoBinarySizeBenchmark1.swift create mode 100644 Benchmarks/SwiftGeoBinarySizeBenchmark1/Tests/SwiftGeoBinarySizeBenchmark1Tests/SwiftGeoBinarySizeBenchmark1Tests.swift diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark/.gitignore b/Benchmarks/SwiftGeoBinarySizeBenchmark/.gitignore new file mode 100644 index 0000000..3b29812 --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Benchmarks/SwiftGeoBinarySizeBenchmark/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark/Package.resolved b/Benchmarks/SwiftGeoBinarySizeBenchmark/Package.resolved new file mode 100644 index 0000000..c93e60a --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark/Package.resolved @@ -0,0 +1,31 @@ +{ + "pins" : [ + { + "identity" : "swift-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-algorithms", + "state" : { + "revision" : "b14b7f4c528c942f121c8b860b9410b2bf57825e", + "version" : "1.0.0" + } + }, + { + "identity" : "swift-nonempty", + "kind" : "remoteSourceControl", + "location" : "https://github.com/RemiBardon/swift-nonempty", + "state" : { + "revision" : "f951b7bcd4f13586307f53b0de5d1b20976aceab" + } + }, + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics", + "state" : { + "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", + "version" : "1.0.2" + } + } + ], + "version" : 2 +} diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark/Package.swift b/Benchmarks/SwiftGeoBinarySizeBenchmark/Package.swift new file mode 100644 index 0000000..9b59a84 --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark/Package.swift @@ -0,0 +1,24 @@ +// swift-tools-version: 5.7 + +import PackageDescription + +let package = Package( + name: "SwiftGeoBinarySizeBenchmark", + platforms: [ + .macOS(.v10_15), + ], + products: [ + .executable( + name: "SwiftGeoBinarySizeBenchmark1", + targets: ["SwiftGeoBinarySizeBenchmark1"] + ), + ], + dependencies: [ + .package(name: "swift-geo", path: "../.."), + ], + targets: [ + .executableTarget(name: "SwiftGeoBinarySizeBenchmark1", dependencies: [ + .product(name: "WGS84", package: "swift-geo"), + ]), + ] +) diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark/README.md b/Benchmarks/SwiftGeoBinarySizeBenchmark/README.md new file mode 100644 index 0000000..11dacd2 --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark/README.md @@ -0,0 +1 @@ +# SwiftGeo binary size benchmark diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark/Sources/SwiftGeoBinarySizeBenchmark1/main.swift b/Benchmarks/SwiftGeoBinarySizeBenchmark/Sources/SwiftGeoBinarySizeBenchmark1/main.swift new file mode 100644 index 0000000..f625381 --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark/Sources/SwiftGeoBinarySizeBenchmark1/main.swift @@ -0,0 +1,8 @@ +import WGS84 + +let point = Point2D(latitude: 10.2, longitude: 20.3) +print(point) +let coordinates = point.coordinates.transformed(toCRS: WGS84Geographic3DCRS.self) +print(coordinates) +print(coordinates.dmsNotation) +print(point.bbox) diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark1/.gitignore b/Benchmarks/SwiftGeoBinarySizeBenchmark1/.gitignore new file mode 100644 index 0000000..3b29812 --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark1/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark1/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Benchmarks/SwiftGeoBinarySizeBenchmark1/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark1/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark1/Package.swift b/Benchmarks/SwiftGeoBinarySizeBenchmark1/Package.swift new file mode 100644 index 0000000..3c057ac --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark1/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version: 5.7 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "SwiftGeoBinarySizeBenchmark1", + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "SwiftGeoBinarySizeBenchmark1", + targets: ["SwiftGeoBinarySizeBenchmark1"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "SwiftGeoBinarySizeBenchmark1", + dependencies: []), + .testTarget( + name: "SwiftGeoBinarySizeBenchmark1Tests", + dependencies: ["SwiftGeoBinarySizeBenchmark1"]), + ] +) diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark1/README.md b/Benchmarks/SwiftGeoBinarySizeBenchmark1/README.md new file mode 100644 index 0000000..e1b8960 --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark1/README.md @@ -0,0 +1,3 @@ +# SwiftGeoBinarySizeBenchmark1 + +A description of this package. diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark1/Sources/SwiftGeoBinarySizeBenchmark1/SwiftGeoBinarySizeBenchmark1.swift b/Benchmarks/SwiftGeoBinarySizeBenchmark1/Sources/SwiftGeoBinarySizeBenchmark1/SwiftGeoBinarySizeBenchmark1.swift new file mode 100644 index 0000000..b1ea254 --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark1/Sources/SwiftGeoBinarySizeBenchmark1/SwiftGeoBinarySizeBenchmark1.swift @@ -0,0 +1,6 @@ +public struct SwiftGeoBinarySizeBenchmark1 { + public private(set) var text = "Hello, World!" + + public init() { + } +} diff --git a/Benchmarks/SwiftGeoBinarySizeBenchmark1/Tests/SwiftGeoBinarySizeBenchmark1Tests/SwiftGeoBinarySizeBenchmark1Tests.swift b/Benchmarks/SwiftGeoBinarySizeBenchmark1/Tests/SwiftGeoBinarySizeBenchmark1Tests/SwiftGeoBinarySizeBenchmark1Tests.swift new file mode 100644 index 0000000..7a99225 --- /dev/null +++ b/Benchmarks/SwiftGeoBinarySizeBenchmark1/Tests/SwiftGeoBinarySizeBenchmark1Tests/SwiftGeoBinarySizeBenchmark1Tests.swift @@ -0,0 +1,11 @@ +import XCTest +@testable import SwiftGeoBinarySizeBenchmark1 + +final class SwiftGeoBinarySizeBenchmark1Tests: XCTestCase { + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(SwiftGeoBinarySizeBenchmark1().text, "Hello, World!") + } +}