Skip to content

Commit

Permalink
🚧 WIP Create binary size benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBardon committed Nov 27, 2022
1 parent 19164e5 commit f95b2ba
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Benchmarks/SwiftGeoBinarySizeBenchmark/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
31 changes: 31 additions & 0 deletions Benchmarks/SwiftGeoBinarySizeBenchmark/Package.resolved
Original file line number Diff line number Diff line change
@@ -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
}
24 changes: 24 additions & 0 deletions Benchmarks/SwiftGeoBinarySizeBenchmark/Package.swift
Original file line number Diff line number Diff line change
@@ -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"),
]),
]
)
1 change: 1 addition & 0 deletions Benchmarks/SwiftGeoBinarySizeBenchmark/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# SwiftGeo binary size benchmark
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 9 additions & 0 deletions Benchmarks/SwiftGeoBinarySizeBenchmark1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
28 changes: 28 additions & 0 deletions Benchmarks/SwiftGeoBinarySizeBenchmark1/Package.swift
Original file line number Diff line number Diff line change
@@ -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"]),
]
)
3 changes: 3 additions & 0 deletions Benchmarks/SwiftGeoBinarySizeBenchmark1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SwiftGeoBinarySizeBenchmark1

A description of this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public struct SwiftGeoBinarySizeBenchmark1 {
public private(set) var text = "Hello, World!"

public init() {
}
}
Original file line number Diff line number Diff line change
@@ -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!")
}
}

0 comments on commit f95b2ba

Please sign in to comment.