File tree 1 file changed +17
-3
lines changed
Benchmarks/Benchmarks/NIOPosixBenchmarks
1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,12 @@ private let eventLoop = MultiThreadedEventLoopGroup.singleton.next()
20
20
let benchmarks = {
21
21
let defaultMetrics : [ BenchmarkMetric ] = [
22
22
. mallocCountTotal,
23
- . cpuTotal
23
+ . cpuTotal,
24
+ . contextSwitches
24
25
]
25
26
26
27
Benchmark (
27
- " TCPEcho " ,
28
+ " TCPEcho pure NIO 1M times " ,
28
29
configuration: . init(
29
30
metrics: defaultMetrics,
30
31
scalingFactor: . one
@@ -36,6 +37,19 @@ let benchmarks = {
36
37
)
37
38
}
38
39
40
+ Benchmark (
41
+ " TCPEcho pure async/await NIO 1M times " ,
42
+ configuration: . init(
43
+ metrics: defaultMetrics,
44
+ scalingFactor: . one
45
+ )
46
+ ) { benchmark in
47
+ try await runTCPEchoAsyncChannel (
48
+ numberOfWrites: 1_000_000 ,
49
+ eventLoop: eventLoop
50
+ )
51
+ }
52
+
39
53
// This benchmark is only available above 5.9 since our EL conformance
40
54
// to serial executor is also gated behind 5.9.
41
55
#if compiler(>=5.9)
@@ -67,7 +81,7 @@ let benchmarks = {
67
81
#if compiler(>=6.0)
68
82
if #available( macOS 15 . 0 , * ) {
69
83
Benchmark (
70
- " TCPEchoAsyncChannel using task executor preference " ,
84
+ " TCPEchoAsyncChannel using task executor preference 1M times " ,
71
85
configuration: . init(
72
86
metrics: defaultMetrics,
73
87
scalingFactor: . one
You can’t perform that action at this time.
0 commit comments