@@ -274,6 +274,40 @@ void equeue_dispatch_many_prof(int count) {
274
274
equeue_destroy (& q );
275
275
}
276
276
277
+ void event_cancel_prof (void ) {
278
+ struct equeue q ;
279
+ equeue_create (& q , 2 * sizeof (struct event ));
280
+
281
+ prof_loop () {
282
+ int id = event_call (& q , no_func , 0 );
283
+
284
+ prof_start ();
285
+ event_cancel (& q , id );
286
+ prof_stop ();
287
+ }
288
+
289
+ equeue_destroy (& q );
290
+ }
291
+
292
+ void event_cancel_many_prof (int count ) {
293
+ struct equeue q ;
294
+ equeue_create (& q , 2 * count * sizeof (struct event ));
295
+
296
+ for (int i = 0 ; i < count ; i ++ ) {
297
+ event_call (& q , no_func , 0 );
298
+ }
299
+
300
+ prof_loop () {
301
+ int id = event_call (& q , no_func , 0 );
302
+
303
+ prof_start ();
304
+ event_cancel (& q , id );
305
+ prof_stop ();
306
+ }
307
+
308
+ equeue_destroy (& q );
309
+ }
310
+
277
311
void event_alloc_size_prof (void ) {
278
312
size_t size = 2 * 32 * sizeof (struct event );
279
313
@@ -346,11 +380,13 @@ int main() {
346
380
prof_measure (event_post_prof );
347
381
prof_measure (event_post_future_prof );
348
382
prof_measure (equeue_dispatch_prof );
383
+ prof_measure (event_cancel_prof );
349
384
350
385
prof_measure (event_alloc_many_prof , 1000 );
351
386
prof_measure (event_post_many_prof , 1000 );
352
387
prof_measure (event_post_future_many_prof , 1000 );
353
388
prof_measure (equeue_dispatch_many_prof , 100 );
389
+ prof_measure (event_cancel_many_prof , 100 );
354
390
355
391
prof_measure (event_alloc_size_prof );
356
392
prof_measure (event_alloc_many_size_prof , 1000 );
0 commit comments