Files
nanoreth/crates/db/benches/encoding_iai.rs
rakita 483bcdf9ab feat(db): Database Abstraction (#101)
* database tx traits

* wip build passes

* Db and tx results

* nightly and db GAT

* Impl tx, wip cursor

* Move Decode to Table Key, working cursor trait

* wip dupsort

* build all Cursor abstraction

* cleanup

* wip cleanup

* old stages

* codecs moved o interface,stages wip

* resolve db ref, it builds

* Add tx commit after execution

* fmt

* Remove sync send restriction

* Add missing rw cursor functions

* Cleanup, added missing cursor fn. rust toolchain

* fmt

* add nightly to ci

* deny dead_code, remove unwrap

* rm printfn, stages fix, bench fix
2022-10-20 08:32:13 -07:00

22 lines
533 B
Rust

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