Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop depending on swift-collections-benchmark #86

Merged
merged 2 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
/*.xcodeproj
xcuserdata/
.*.sw?
/Benchmarks/.swiftpm
/Benchmarks/.build

This file was deleted.

4 changes: 2 additions & 2 deletions Package.resolved → Benchmarks/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "986d191f94cec88f6350056da59c2e59e83d1229",
"version": "0.4.3"
"revision": "83b23d940471b313427da226196661856f6ba3e0",
"version": "0.4.4"
}
},
{
Expand Down
47 changes: 47 additions & 0 deletions Benchmarks/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// swift-tools-version:5.3
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//

import PackageDescription

let package = Package(
name: "swift-collections.Benchmarks",
dependencies: [
.package(name: "swift-collections", path: ".."),
.package(url: "https://github.com/apple/swift-collections-benchmark", from: "0.0.1"),
],
targets: [
.target(
name: "Benchmarks",
dependencies: [
.product(name: "Collections", package: "swift-collections"),
.product(name: "CollectionsBenchmark", package: "swift-collections-benchmark"),
"CppBenchmarks",
],
path: "Benchmarks",
resources: [
.copy("Library.json"),
]
),
.target(
name: "CppBenchmarks",
path: "CppBenchmarks"
),
.target(
name: "benchmark",
dependencies: [
"Benchmarks",
],
path: "benchmark-tool"
),
],
cxxLanguageStandard: .cxx1z
)
32 changes: 1 addition & 31 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ let package = Package(
.library(name: "OrderedCollections", targets: ["OrderedCollections"]),
.library(name: "PriorityQueueModule", targets: ["PriorityQueueModule"]),
],
dependencies: [
// This is only used in the benchmark executable target.
.package(url: "https://github.com/apple/swift-collections-benchmark", from: "0.0.1"),
],
targets: [
.target(
name: "Collections",
Expand Down Expand Up @@ -88,31 +84,6 @@ let package = Package(
dependencies: ["CollectionsTestSupport"],
swiftSettings: settings),

// Benchmarking
.target(
name: "Benchmarks",
dependencies: [
.product(name: "CollectionsBenchmark", package: "swift-collections-benchmark"),
"Collections",
"CppBenchmarks",
],
path: "Benchmarks/Benchmarks",
resources: [
.copy("Library.json"),
]
),
.target(
name: "CppBenchmarks",
path: "Benchmarks/CppBenchmarks"
),
.target(
name: "swift-collections-benchmark",
dependencies: [
"Benchmarks",
],
path: "Benchmarks/swift-collections-benchmark"
),

// Deque<Element>
.target(
name: "DequeModule",
Expand Down Expand Up @@ -142,6 +113,5 @@ let package = Package(
name: "PriorityQueueTests",
dependencies: ["PriorityQueueModule"],
swiftSettings: settings),
],
cxxLanguageStandard: .cxx1z
]
)
4 changes: 2 additions & 2 deletions Utils/run-benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu

srcroot="$(dirname "$0")/.."
srcroot="$(dirname "$0")/../Benchmarks"
results="batch.results"

command="${1:-help}"
Expand All @@ -12,7 +12,7 @@ run() {
local flags
flags="-c release"
flags="$flags -Xswiftc -Xllvm -Xswiftc -align-module-to-page-size"
swift run --package-path "$srcroot" $flags swift-collections-benchmark "$@"
swift run --package-path "$srcroot" $flags benchmark "$@"
}

case "$command" in
Expand Down