Closed nvzqz closed 10 months ago
@nvzqz Thanks for taking a look, and for making divan!
I really like the clear output generated by divan, and how fast it is (criterion took several seconds for each benchmark).
By the way, is it possible to parameterize benchmarks by something other than numbers (e.g. strings)? I don't particularly like the macros I had to write.
I really like the clear output generated by divan, and how fast it is (criterion took several seconds for each benchmark).
Those two aspects were very intentional, thanks!
is it possible to parameterize benchmarks by something other than numbers (e.g. strings)? I don't particularly like the macros I had to write.
Not yet. I plan to support runtime parameters similar to the consts
parameter:
#[divan::bench(args = ["a", "b", "c"])]
fn bench(s: &str) {
...
}
// or
#[divan::bench(args = ["a", "b", "c"])]
fn bench(b: Bencher, s: &str) {
...
}
Note that the arguments will be printed verbatim in the hierarchy using std::fmt::Display
.
example
╰─ bench
├─ a
├─ b
╰─ c
So I recommend having them be either:
Description
The benchmarking code was calling
black_box
when:black_box
when generating inputs since that part of the code isn't being measured, so you're running less optimal code for no benefit.black_box
, so there is no need to call it again for inputs.Also, thanks for using Divan! I'm excited to see how folks are using it. ❤️