divan icon indicating copy to clipboard operation
divan copied to clipboard

Pass multiple generic consts to bench

Open rosingrind opened this issue 7 months ago • 3 comments

It seems to be not possible to pass multiple generic consts to benchmark, for example:

#[divan::bench(consts = [[1, 2], [3, 4]])]
fn insert_one<const N: usize, const M: usize>(_: Bencher) {
    assert_eq!(N, 1); // or 3
    assert_eq!(M, 2); // or 4
}

rosingrind avatar May 26 '25 11:05 rosingrind

Divan 0.2 will allow for providing an arbitrary number of any kind of parameter (args, consts, types). I've already implemented this. 🙂

nvzqz avatar May 27 '25 13:05 nvzqz

Oh well, that's awesome! If so, feel free to close the issue whenever you feel like :) btw are there any plans to release 0.2 any time soon? I see no deadline on the milestone, but felt like asking off my curiosity

rosingrind avatar May 27 '25 18:05 rosingrind

I've already posted many incorrect estimates for when the 0.2 release will be. Life gets in the way, this is free volunteer work, and some features created unexpected challenges — so I'll just say it'll be ready when it's ready. Might still be 1–3 months out, unless someone pays me to focus on this full-time.

nvzqz avatar May 28 '25 00:05 nvzqz