Description
edit by @PragTob: This is the original issue, we arrived at the solution though that custom collectors would solve this: #444 (comment)
Hello,
In order to not pollute the computation of something with the process dictionary being already fed with memoized results, I have a function that I would benchmark which boils down to basically this:
fn input ->
parent = self()
spawn_link(fn -> send(parent, acutal_computation(input)) end)
receive(do: (msg -> msg))
end
Problem is that the "entrypoint" that I can give to benchee must be the external function, to keep the isolation.
Is there a way to provide benchee with a special scenario, something like that:
fn input ->
parent = self()
spawn_link(fn ->
_result = acutal_computation(input) # not used for benchmark
measurements = Benchee.some_function_to_capture_measurements()
send(parent, measurements)
end)
# return the measurements to benchee
receive(do: (msg -> msg))
end
I want to do that first because the measurements should be taken deeper in the call stack, here it's just for the example. And secondly because for memory consumption I don't know if benchee looks at the whole system or just the current process (I guess it does the segond given the code I have read). So If the function spawn the memory will be off.
Edit:
Like memory measurements, this only tracks reductions directly in the function given to benchee, not processes spawned by it or other processes it uses.
Thank you