Skip to content

Commit

Permalink
add benchmarking for node_from_bytes_backrefs_old
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-o-how committed Jan 17, 2025
1 parent 4e58534 commit cb47c16
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions benches/deserialize.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use clvmr::allocator::Allocator;
use clvmr::serde::{
node_from_bytes, node_from_bytes_backrefs, node_to_bytes_backrefs,
serialized_length_from_bytes, serialized_length_from_bytes_trusted, tree_hash_from_stream,
node_from_bytes, node_from_bytes_backrefs, node_from_bytes_backrefs_old,
node_to_bytes_backrefs, serialized_length_from_bytes, serialized_length_from_bytes_trusted,
tree_hash_from_stream,
};
use criterion::{criterion_group, criterion_main, Criterion};
use std::include_bytes;
Expand Down Expand Up @@ -64,6 +65,15 @@ fn deserialize_benchmark(c: &mut Criterion) {
start.elapsed()
})
});

group.bench_function(format!("node_from_bytes_backrefs_old{name_suffix}"), |b| {
b.iter(|| {
a.restore_checkpoint(&iter_checkpoint);
let start = Instant::now();
node_from_bytes_backrefs_old(&mut a, bl).expect("node_from_bytes_backrefs_old");
start.elapsed()
})
});
}

let mut a = Allocator::new();
Expand Down

0 comments on commit cb47c16

Please sign in to comment.