mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
22 lines
543 B
Rust
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);
|