bheisler / iai

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

Support `#[cfg(...)]` in `iai::main!` #28

Open LoganDark opened 2 years ago

LoganDark commented 2 years ago

My crate has optional features that I'd like to be able to exclude from the iai run, but the iai::main! macro does not support attributes on each entry, meaning that the best I can do is cfg over the entire macro invocation. This becomes unwieldy fast as the number of possible permutations increases.

https://github.com/LoganDark/stackblur-iter/commit/b9843dce59781d2601b8f73301d21c8e8f33a733#diff-edcd762950a4c63a41c0121bf75b104e97b31a2e17652edf0361f0079d0ce6c2R46-R86