@@ -32,7 +32,7 @@ use tokio::runtime::Runtime;
32
32
// Benchmark how long does it take to process 1KB message on 1, 10, 100, 1K hosts with 8 GPUs each
33
33
fn bench_actor_scaling ( c : & mut Criterion ) {
34
34
let mut group = c. benchmark_group ( "actor_scaling" ) ;
35
- let host_counts = vec ! [ 1 , 10 , 100 , 1000 ] ;
35
+ let host_counts = vec ! [ 1 , 10 , 100 ] ;
36
36
let message_size = 1024 ; // Fixed message size (1KB)
37
37
group. sample_size ( 10 ) ;
38
38
group. sampling_mode ( criterion:: SamplingMode :: Flat ) ;
@@ -49,7 +49,7 @@ fn bench_actor_scaling(c: &mut Criterion) {
49
49
. await
50
50
. unwrap ( ) ;
51
51
52
- let proc_mesh = ProcMesh :: allocate ( alloc) . await . unwrap ( ) ;
52
+ let mut proc_mesh = ProcMesh :: allocate ( alloc) . await . unwrap ( ) ;
53
53
let actor_mesh: RootActorMesh < BenchActor > = proc_mesh
54
54
. spawn ( "bench" , & ( Duration :: from_millis ( 0 ) ) )
55
55
. await
@@ -79,7 +79,15 @@ fn bench_actor_scaling(c: &mut Criterion) {
79
79
}
80
80
}
81
81
82
- start. elapsed ( )
82
+ let elapsed = start. elapsed ( ) ;
83
+ proc_mesh
84
+ . events ( )
85
+ . unwrap ( )
86
+ . into_alloc ( )
87
+ . stop_and_wait ( )
88
+ . await
89
+ . expect ( "Failed to stop allocator" ) ;
90
+ elapsed
83
91
} ) ;
84
92
} ) ;
85
93
}
@@ -131,7 +139,7 @@ fn bench_actor_mesh_message_sizes(c: &mut Criterion) {
131
139
. await
132
140
. unwrap ( ) ;
133
141
134
- let proc_mesh = ProcMesh :: allocate ( alloc) . await . unwrap ( ) ;
142
+ let mut proc_mesh = ProcMesh :: allocate ( alloc) . await . unwrap ( ) ;
135
143
let actor_mesh: RootActorMesh < BenchActor > = proc_mesh
136
144
. spawn ( "bench" , & ( Duration :: from_millis ( 0 ) ) )
137
145
. await
@@ -161,8 +169,15 @@ fn bench_actor_mesh_message_sizes(c: &mut Criterion) {
161
169
msg_rcv += 1 ;
162
170
}
163
171
}
164
-
165
- start. elapsed ( )
172
+ let elapsed = start. elapsed ( ) ;
173
+ proc_mesh
174
+ . events ( )
175
+ . unwrap ( )
176
+ . into_alloc ( )
177
+ . stop_and_wait ( )
178
+ . await
179
+ . expect ( "Failed to stop allocator" ) ;
180
+ elapsed
166
181
} ) ;
167
182
} ,
168
183
) ;
0 commit comments