You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks for provding this library, so far i've really enjoyed using it :>
i really hope i didn't miss anything that this already exists sometimes i am a bit very silly when it comes to properly reading the docs.
request
adding an an optional closure that can be passed to a Bencher that is called after each bench run through but not counted towards the measurment time. (like i guess smth like bencher.with_cleanup(closure) that then runs somewhere at the end of bench_loop_threaded {hope i understood the code correctly there})
motivation
i am looking into benching some sql queries and i wanted to run DISCARD after every bench run so as to clear the caches a bit. and i think this is a general thing of wanting to clear a cache is something that comes up often in benching.
capacities on my end
i am doing this as a free time thing so i have time to look into this and can also imagine writing a pr. allthough i am not certain my code quality would be up to par but i mean i can try.
best regards
The text was updated successfully, but these errors were encountered:
You can accomplish this today with Drop by returning something from the benchmark, and it will run for every iteration. But it will be after the timing, so it depends on how caches are being used if multiple iterations are included in the sample. You might want to limit it with #[divan::bench(sample_size = 1)].
hey thank you for your reply and sorry for this late reply!
i did try out the implementation via Drop and that felt like a nice api to use allthough i didn't figure out getting around the postgres cache even with the sample_size=1. i think i am gonna put this postgres endeavour to the side for now. i will try to find some time to try some things out with this. but i may be rather slow to get to work on it.
hey there :3
thanks for provding this library, so far i've really enjoyed using it :>
i really hope i didn't miss anything that this already exists sometimes i am a bit very silly when it comes to properly reading the docs.
request
adding an an optional closure that can be passed to a
Bencher
that is called after each bench run through but not counted towards the measurment time. (like i guess smth likebencher.with_cleanup(closure)
that then runs somewhere at the end ofbench_loop_threaded
{hope i understood the code correctly there})motivation
i am looking into benching some sql queries and i wanted to run
DISCARD
after every bench run so as to clear the caches a bit. and i think this is a general thing of wanting to clear a cache is something that comes up often in benching.capacities on my end
i am doing this as a free time thing so i have time to look into this and can also imagine writing a pr. allthough i am not certain my code quality would be up to par but i mean i can try.
best regards
The text was updated successfully, but these errors were encountered: