mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-20 06:18:31 +00:00
Add benches, examples for cached hashing.
Ignore flamegraph files
This commit is contained in:
11
eth2/utils/cached_tree_hash/examples/8k_hashes_standard.rs
Normal file
11
eth2/utils/cached_tree_hash/examples/8k_hashes_standard.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use cached_tree_hash::TreeHashCache;
|
||||
use ethereum_types::H256 as Hash256;
|
||||
use tree_hash::TreeHash;
|
||||
|
||||
fn main() {
|
||||
let n = 2048;
|
||||
|
||||
let vec: Vec<Hash256> = (0..n).map(|_| Hash256::random()).collect();
|
||||
|
||||
vec.tree_hash_root();
|
||||
}
|
||||
Reference in New Issue
Block a user