bheisler / iai

Experimental one-shot benchmarking/profiling harness for Rust
Apache License 2.0
578 stars 23 forks source link

Share benchmark code between iai and criterion? #16

Open bjchambers opened 3 years ago

bjchambers commented 3 years ago

Is there a way to share benchmark code between criterion and iai? I'm wondering if it would be possible for it to just be a switch for how the benchmarks are run, or a macro, etc. It seems like criterion is useful for getting real timings, while iai is useful in CI, so I could see a case for supporting both, and running one locally and the other in CI.

I guess you could create a library with the benchmark code, and then have criterion and iai main benchmark programs that just call into that, but I was wondering if it would be feasible to avoid the repetition?