nvzqz / divan

Fast and simple benchmarking for Rust projects
https://nikolaivazquez.com/blog/divan/
Apache License 2.0
849 stars 24 forks source link

Support for async functions #39

Open quambene opened 7 months ago

quambene commented 7 months ago

I was trying out divan, and I'm wondering if there is support for benchmarking async functions, e.g. using a tokio runtime (cf. https://bheisler.github.io/criterion.rs/book/user_guide/benchmarking_async.html#benchmarking-async-functions)?

Feel free to close this issue if this was answered elsewhere.

nvzqz commented 7 months ago

I plan to support async functions and have some code in progress for it. This will likely come soon after allocation profiling. It wouldn't be until after or during the end of the month.

nvzqz commented 7 months ago

Update: I now have an implementation of allocation profiling in https://github.com/nvzqz/divan/pull/40. So maybe a week after that lands I'll get around to finishing async support.

dan-da commented 3 months ago

I'm glad to hear this is in progress. any update?

I recently converted a couple modules from sync to async. I have divan benches for them that I can't build with the new async implementations.

nvzqz commented 1 week ago

I'm currently prioritizing #10/#42 but I plan to support async benchmarks soon after. In the meantime, it seems folks have gotten acceptable results from just invoking block_on within the benchmark. My main motivation with async benchmarks is to move block_on overhead out of the sample time.