@@ -80,6 +80,11 @@ pub fn keys_query(c: &mut Criterion) {
80
80
. iter ( || async { machine. mark_request_as_sent ( & txn_id, response) . await . unwrap ( ) } )
81
81
} ) ;
82
82
83
+ {
84
+ let _guard = runtime. enter ( ) ;
85
+ drop ( machine) ;
86
+ }
87
+
83
88
group. finish ( )
84
89
}
85
90
@@ -108,7 +113,10 @@ pub fn keys_claiming(c: &mut Criterion) {
108
113
( machine, & runtime, & txn_id)
109
114
} ,
110
115
move |( machine, runtime, txn_id) | {
111
- runtime. block_on ( machine. mark_request_as_sent ( txn_id, response) ) . unwrap ( )
116
+ runtime. block_on ( async {
117
+ machine. mark_request_as_sent ( txn_id, response) . await . unwrap ( ) ;
118
+ drop ( machine) ;
119
+ } )
112
120
} ,
113
121
BatchSize :: SmallInput ,
114
122
)
@@ -130,7 +138,10 @@ pub fn keys_claiming(c: &mut Criterion) {
130
138
( machine, & runtime, & txn_id)
131
139
} ,
132
140
move |( machine, runtime, txn_id) | {
133
- runtime. block_on ( machine. mark_request_as_sent ( txn_id, response) ) . unwrap ( )
141
+ runtime. block_on ( async {
142
+ machine. mark_request_as_sent ( txn_id, response) . await . unwrap ( ) ;
143
+ drop ( machine)
144
+ } )
134
145
} ,
135
146
BatchSize :: SmallInput ,
136
147
)
@@ -180,6 +191,7 @@ pub fn room_key_sharing(c: &mut Criterion) {
180
191
machine. invalidate_group_session ( room_id) . await . unwrap ( ) ;
181
192
} )
182
193
} ) ;
194
+
183
195
let dir = tempfile:: tempdir ( ) . unwrap ( ) ;
184
196
let store = Arc :: new ( runtime. block_on ( SqliteCryptoStore :: open ( dir. path ( ) , None ) ) . unwrap ( ) ) ;
185
197
@@ -209,6 +221,11 @@ pub fn room_key_sharing(c: &mut Criterion) {
209
221
} )
210
222
} ) ;
211
223
224
+ {
225
+ let _guard = runtime. enter ( ) ;
226
+ drop ( machine) ;
227
+ }
228
+
212
229
group. finish ( )
213
230
}
214
231
@@ -249,6 +266,11 @@ pub fn devices_missing_sessions_collecting(c: &mut Criterion) {
249
266
} )
250
267
} ) ;
251
268
269
+ {
270
+ let _guard = runtime. enter ( ) ;
271
+ drop ( machine) ;
272
+ }
273
+
252
274
group. finish ( )
253
275
}
254
276
0 commit comments