There's a measure that I want to do and I haven't managed to achieve this using Bechamel. The end goal is to measure the memory footprint of values using Obj.reachable_words.
Suppose that we want to compare the memory footprint of different implementations of semi-persisent lists.
Let's consider that we have a module type SP_LIST and different implementations: module A : SP_LIST and module B : SP_LIST.
Then we have a generic test signature with a make_list function that will allocate a value, let's call it v, that will be passed to the function bench, which will be the basis of the test. I would like to compare the foot print of v before and after the call of bench.
module type TEST = functor (Impl : SP_LIST) -> sig
type t
val make_list : unit -> t
val bench : int -> t -> unit
end
My idea was to try to make a test with resources for modules A and B and then, use the alloc and free functions to register the values of interest in a table that is read by the measurement module and use Ob.reachable_words.
However, this doesn't work. When the test is set up with multiple allocations the alloc and free functions are called exactly once for each run of n executions of bench. So the measured values keep decreasing as n grows. This is because the footprint of execution n doesn't add up to the execution n+1 of bench.
I would like to make a feature request, that I'm willing to implement, to add such measurement features. Although I don't know which design would fit properly with Bechamel's mindset.
There's a measure that I want to do and I haven't managed to achieve this using Bechamel. The end goal is to measure the memory footprint of values using
Obj.reachable_words.Suppose that we want to compare the memory footprint of different implementations of semi-persisent lists.
Let's consider that we have a module type
SP_LISTand different implementations:module A : SP_LISTandmodule B : SP_LIST.Then we have a generic test signature with a
make_listfunction that will allocate a value, let's call itv, that will be passed to the functionbench, which will be the basis of the test. I would like to compare the foot print ofvbefore and after the call ofbench.My idea was to try to make a test with resources for modules
AandBand then, use theallocandfreefunctions to register the values of interest in a table that is read by the measurement module and useOb.reachable_words.However, this doesn't work. When the test is set up with
multipleallocations theallocandfreefunctions are called exactly once for each run ofnexecutions ofbench. So the measured values keep decreasing asngrows. This is because the footprint of executionndoesn't add up to the executionn+1ofbench.I would like to make a feature request, that I'm willing to implement, to add such measurement features. Although I don't know which design would fit properly with Bechamel's mindset.