Skip to content

Commit

Permalink
Update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
hassila committed Aug 16, 2023
1 parent cb4a765 commit 9ec7f91
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Benchmarks/Foundation/Foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let benchmarks = {
thresholds: [.wallClock: customThreshold,
.throughput: customThreshold2])

Benchmark.defaultConfiguration.metrics = [.throughput, .wallClock] + BenchmarkMetric.arc
Benchmark.defaultConfiguration.metrics = [.throughput, .wallClock] + .arc

Benchmark("Foundation Date()",
configuration: .init(scalingFactor: .mega)) { benchmark in
Expand Down
2 changes: 1 addition & 1 deletion Benchmarks/MemoryOne/MemoryOne.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Foundation
import Benchmark

let benchmarks = {
Benchmark.defaultConfiguration.metrics = BenchmarkMetric.memory + BenchmarkMetric.arc
Benchmark.defaultConfiguration.metrics = .memory + .arc
Benchmark.defaultConfiguration.maxDuration = .seconds(3)
Benchmark.defaultConfiguration.scalingFactor = .kilo

Expand Down
2 changes: 1 addition & 1 deletion Benchmarks/MemoryTwo/MemoryTwo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Foundation
import Benchmark

let benchmarks = {
Benchmark.defaultConfiguration.metrics = BenchmarkMetric.memory + BenchmarkMetric.arc
Benchmark.defaultConfiguration.metrics = .memory + .arc
Benchmark.defaultConfiguration.maxDuration = .seconds(3)
Benchmark.defaultConfiguration.scalingFactor = .kilo

Expand Down
2 changes: 1 addition & 1 deletion Benchmarks/Miscellaneous/Miscellaneous.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let benchmarks = {
}
}

Benchmark.defaultConfiguration = .init(metrics: BenchmarkMetric.memory + BenchmarkMetric.arc)
Benchmark.defaultConfiguration = .init(metrics: .memory + .arc)

Benchmark("Memory leak 123 allocations of 4K") { _ in
performAllocations(count: 123, size: 4096, shouldFree: false)
Expand Down
12 changes: 6 additions & 6 deletions Benchmarks/Samples/Samples.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ let benchmarks = {
}

Benchmark("Extended metrics",
configuration: .init(metrics: BenchmarkMetric.extended)) { _ in
configuration: .init(metrics: .extended)) { _ in
dummyCounter(defaultCounter())
}

Expand All @@ -100,7 +100,7 @@ let benchmarks = {
}

Benchmark("Extended + custom metrics",
configuration: .init(metrics: BenchmarkMetric.extended +
configuration: .init(metrics: .extended +
[CustomMetrics.one, CustomMetrics.two])) { benchmark in
dummyCounter(defaultCounter())
benchmark.measurement(CustomMetrics.one, Int.random(in: 1 ... 1_000_000))
Expand Down Expand Up @@ -136,7 +136,7 @@ let benchmarks = {

Benchmark("Disk metrics, writing 64K x 1.000",
configuration: .init(
metrics: BenchmarkMetric.disk,
metrics: .disk,
scalingFactor: .kilo,
maxDuration: .seconds(1)
)) { benchmark in
Expand Down Expand Up @@ -176,17 +176,17 @@ let benchmarks = {
}

Benchmark("Memory metrics, async",
configuration: .init(metrics: BenchmarkMetric.memory)) { _ in
configuration: .init(metrics: .memory)) { _ in
await concurrentWork(tasks: 10, mallocs: 1000)
}

Benchmark("System metrics, async",
configuration: .init(metrics: BenchmarkMetric.system)) { _ in
configuration: .init(metrics: .system)) { _ in
await concurrentWork(mallocs: 10)
}

Benchmark("All metrics, full concurrency, async",
configuration: .init(metrics: BenchmarkMetric.all, maxDuration: .seconds(1))) { _ in
configuration: .init(metrics: .all, maxDuration: .seconds(1))) { _ in
await concurrentWork(tasks: 80)
}

Expand Down
12 changes: 6 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/ordo-one/package-benchmark",
"state" : {
"revision" : "874ee0c184a4e89be111349b8dab2e61b6773937",
"version" : "1.6.1"
"revision" : "8cc2be5e4d0c91feea6d41ba20c05ee1a053d456",
"version" : "1.8.1"
}
},
{
"identity" : "package-datetime",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ordo-one/package-datetime",
"state" : {
"revision" : "9c1e16bfe7683e787161f866ff8b5cbc88089cb4",
"version" : "0.0.6"
"revision" : "d1242188c9f48aad297e6ca9b717776f8660bc31",
"version" : "1.0.2"
}
},
{
Expand Down Expand Up @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a",
"version" : "1.2.2"
"revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version" : "1.2.3"
}
},
{
Expand Down

0 comments on commit 9ec7f91

Please sign in to comment.