Files
nanoreth/crates/storage/db/benches/encoding_iai.rs
2022-12-09 23:14:07 -08:00

22 lines
543 B
Rust

use iai::{black_box, main};
use reth_db::tables::codecs;
/// Benchmarks the encoding and decoding of `Header` using iai.
macro_rules! impl_iai_encoding_benchmark {
($name:tt) => {
fn $name() {
codecs::fuzz::IntegerList::encode_and_decode(black_box(
reth_primitives::IntegerList::default(),
));
}
main!($name);
};
}
#[cfg(not(feature = "bench-postcard"))]
impl_iai_encoding_benchmark!(scale);
#[cfg(feature = "bench-postcard")]
impl_iai_encoding_benchmark!(postcard);