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