Open HEnquist opened 3 years ago
Hey, thanks for trying Iai. Good suggestion.
In the meantime, it's basically the same deal as for Criterion.rs, only use #[iai]
for your benchmark functions instead of #[criterion]
.
Got it! I had disabled the testing harness. I enabled it again and things started working just fine.
Note that for #[criterion] benchmarks, we don't need to disable the normal testing harness as we do with regular Criterion.rs benchmarks.
I read this as "it doesn't matter if you disable the normal testing harness or not". But I guess the harness is really needed.
I think just copy-pasting this: https://github.com/bheisler/iai/blob/main/macro/benches/test_macro_bench.rs to the readme, together with the relevant bits of Cargo.toml and two lines of explanation would be enough.
Please see https://github.com/bheisler/iai/pull/6
I played a bit with iai yesterday and was really impressed by the stable results. Then I also made a quick attempt to use the iai_macro but couldn't figure out what to do. Could you add a simple example?