val make_indexed : name:string -> ?fmt:fmt_indexed -> args:int list -> (int -> (unit -> 'a) Staged.t) -> t
This gives space for performing actions before a benchmark (after receiving the int), and during an individual run (after receiving the unit), but as far as I can see there's no hook into performing actions after a run. This feature could be useful for benchmarks that need to close their resources after they're done.
In my particular case, I have a test that wants to map a big chunk of memory, benchmark individual operations, then teardown that memory:
let noop_run size =
let t = Uring.create ~queue_depth:size () in
Staged.stage (fun () ->
for i = 1 to size do let r = Uring.noop t i in assert r done;
let submitted = Uring.submit t in assert (submitted = size);
for _ = 1 to size do ignore (Uring.wait t : (int * int) option) done)
(* Want to run [Uring.exit] somewhere, to avoid a memory leak. *)
The type of
Test.make_indexed
is currently:This gives space for performing actions before a benchmark (after receiving the
int
), and during an individual run (after receiving theunit
), but as far as I can see there's no hook into performing actions after a run. This feature could be useful for benchmarks that need to close their resources after they're done.In my particular case, I have a test that wants to map a big chunk of memory, benchmark individual operations, then teardown that memory: