Skip to content
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
13 changes: 13 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# file options

--exclude .build

# format options

--self insert
--patternlet inline
--stripunusedargs unnamed-only
--comments ignore
--ifdef no-indent

# rules
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
//
//===----------------------------------------------------------------------===//

import Foundation
import DistributedActors
import Foundation

// Just consume the argument.
// It's important that this function is in another module than the tests
// which are using it.
@inline(never)
public func blackHole<T>(_ x: T) {
}
public func blackHole<T>(_: T) {}

// Return the passed argument without letting the optimizer know that.
@inline(never)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@

import DistributedActors


func run(identifier: String) {
let system = ActorSystem("\(identifier)")

measure(identifier: identifier) {
var i = 0
for _ in 0..<100 {
for _ in 0 ..< 100 {
let _: ActorRef<String> = try! system.spawn(.anonymous, .ignore)
i += 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@

import DistributedActors


func run(identifier: String) {
let system = ActorSystem("\(identifier)")

measure(identifier: identifier) {
var i = 0
for _ in 0..<1000 {
for _ in 0 ..< 1000 {
let _: ActorRef<String> = try! system.spawn(.anonymous, .ignore)
i += 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@

import DistributedActors


func run(identifier: String) {
let system = ActorSystem("\(identifier)")

measure(identifier: identifier) {
// TODO replicate ping pong benchmark here, so we know how much a message send allocates
// TODO: replicate ping pong benchmark here, so we know how much a message send allocates
}

system.shutdown()
Expand Down
22 changes: 10 additions & 12 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@ let targets: [PackageDescription.Target] = [
"DistributedActorsConcurrencyHelpers",
"CDistributedActorsMailbox",
"CDistributedActorsRunQueue",
"SwiftProtobuf"
"SwiftProtobuf",
]
),

.target(
name: "DistributedActorsSampleProcessIsolated",
dependencies: [
"DistributedActors"
"DistributedActors",
]
),


/// This target is intended only for use in tests, though we have no way to mark this
.target(
name: "DistributedActorsTestKit",
Expand All @@ -45,8 +44,7 @@ let targets: [PackageDescription.Target] = [

// NOT SUPPORTED transient library until Swift receives Atomics
.target(name: "CDistributedActorsAtomics",
dependencies: []
),
dependencies: []),

// NOT SUPPORTED transient library until Swift receives Atomics
.target(
Expand Down Expand Up @@ -79,8 +77,8 @@ let targets: [PackageDescription.Target] = [
.target(
name: "DistributedActorsBenchmarks",
dependencies: [
"DistributedActors",
"SwiftBenchmarkTools"
"DistributedActors",
"SwiftBenchmarkTools",
]
),
.target(
Expand All @@ -105,15 +103,15 @@ let targets: [PackageDescription.Target] = [
.testTarget(
name: "DistributedActorsDocumentationTests",
dependencies: ["DistributedActors", "DistributedActorsTestKit"]
)
),
]

let dependencies: [Package.Dependency] = [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.7.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.7.0"),
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.2.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.2.0"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.4.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.2.0"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.4.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
]

let package = Package(
Expand Down
Loading