Skip to content

Commit cb67cb2

Browse files
committed
Moved code around
1 parent 3cad1af commit cb67cb2

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

Benchmarks/Benchmarks/NIOPosixBenchmarks/Benchmarks.swift

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,28 @@ let benchmarks = {
7777
)
7878
}
7979

80+
#if compiler(>=6.0)
81+
if #available(macOS 15.0, *) {
82+
Benchmark(
83+
"TCPEchoAsyncChannel using task executor preference 1M times",
84+
configuration: .init(
85+
metrics: defaultMetrics,
86+
scalingFactor: .one
87+
// We are expecting a bit of allocation variance due to an allocation
88+
// in the Concurrency runtime which happens when resuming a continuation.
89+
// thresholds: [.mallocCountTotal: .init(absolute: [.p90: 2000])]
90+
)
91+
) { benchmark in
92+
try await withTaskExecutorPreference(eventLoop.taskExecutor) {
93+
try await runTCPEchoAsyncChannel(
94+
numberOfWrites: 1_000_000,
95+
eventLoop: eventLoop
96+
)
97+
}
98+
}
99+
}
100+
#endif
101+
80102
Benchmark(
81103
"MTELG.scheduleTask(in:_:)",
82104
configuration: Benchmark.Configuration(
@@ -110,26 +132,4 @@ let benchmarks = {
110132
let handle = try! eventLoop.scheduleCallback(in: .hours(1), handler: timer)
111133
}
112134
}
113-
114-
#if compiler(>=6.0)
115-
if #available(macOS 15.0, *) {
116-
Benchmark(
117-
"TCPEchoAsyncChannel using task executor preference 1M times",
118-
configuration: .init(
119-
metrics: defaultMetrics,
120-
scalingFactor: .one
121-
// We are expecting a bit of allocation variance due to an allocation
122-
// in the Concurrency runtime which happens when resuming a continuation.
123-
// thresholds: [.mallocCountTotal: .init(absolute: [.p90: 2000])]
124-
)
125-
) { benchmark in
126-
try await withTaskExecutorPreference(eventLoop.taskExecutor) {
127-
try await runTCPEchoAsyncChannel(
128-
numberOfWrites: 1_000_000,
129-
eventLoop: eventLoop
130-
)
131-
}
132-
}
133-
}
134-
#endif
135135
}

0 commit comments

Comments
 (0)