Skip to content
LogoLogo

Benchmarks

MerkleForge uses Criterion benchmarks in the unpublished merkle-bench crate to compare hash adapters, tree variants, proof generation, proof verification, and other Rust Merkle libraries. Criterion reports mean, median, and standard deviation to filter out noise.

Lower latency is better; higher throughput is better. For the latest CI numbers with links to every Criterion report, see the live benchmark explorer.

Environment

CPU11th Gen Intel Core i7-1185G7 @ 3.00 GHz, 4 cores / 8 threads, x86_64
RAM15 GiB
OSLinux 7.0.0-28-generic x86_64
Rustrustc 1.97.1 (8bab26f4f 2026-07-14)
Date2026-08-17

Hash function throughput

cargo bench --bench hash_throughput

Algorithm32 B latency64 B latency1 MB throughput
SHA-256109.60 ns177.40 ns1.28 GiB/s
Keccak-2561.23 µs660.99 ns291.12 MiB/s
BLAKE3230.70 ns247.83 ns5.99 GiB/s

Binary Merkle tree

cargo bench --bench binary_tree

LeavesConstruction (SHA-256)Construction (BLAKE3)Proof genProof verify
100147.19 µs140.96 µs45.22 ns1.09 µs
1,0001.80 ms1.83 ms57.21 ns1.87 µs
10,00030.53 ms39.07 ms74.18 ns2.06 µs
100,000268.23 ms274.93 ms78.69 ns2.95 µs

Construction builds a fresh BinaryMerkleTree<H>. Proof generation uses LeafIndex(0). Proof verification checks the proof against the recorded root and the original leaf bytes.

Sparse Merkle tree

cargo bench --bench sparse_tree (SHA-256)

Existing keysInsertProof genProof verifyNon-membership proofNon-membership verify
10189.85 µs244.18 µs91.43 µs268.20 µs74.38 µs
1002.11 ms2.25 ms75.74 µs2.32 ms76.86 µs
1,00020.24 ms20.32 ms81.58 µs20.12 ms71.28 µs
10,000181.05 ms198.84 ms63.00 µs203.49 ms76.41 µs

Batch updates

Batch sizeBatch insertSequential insertSpeedup
10288.97 µs1.53 ms5.30×
1002.08 ms88.12 ms42.46×
1,00020.33 ms8.69 s427.72×

Merkle Patricia trie

cargo bench --bench patricia_trie (Keccak-256)

Existing entriesInsertGetProof genProof verify
1020.61 µs159.00 nsnot capturednot captured
100217.63 µs200.07 nsnot capturednot captured
1,0002.11 ms270.26 nsnot capturednot captured
10,000not captured387.44 nsnot capturednot captured

State-root timings (patricia_trie/state_root) were not captured in this run.

Energy-aware construction

cargo bench --bench bench_energy builds a 100,000-leaf binary tree.

Algorithm100K construction timeCPU cyclesPackage energy
SHA-256463.52 msnot capturednot captured
Keccak-2561.49 snot capturednot captured
BLAKE3261.02 msnot capturednot captured

These are Criterion wall-clock numbers only. See Profiling & energy to collect RAPL counters.

MerkleForge vs rs-merkle vs merkle_light

cargo bench --bench comparison

MetricMerkleForgers-merklemerkle_light
10K leaf construction22.77 ms3.69 ms2.29 ms
Proof size (10K tree)469 bytes448 bytes512 bytes
Proof verification1.84 µs6.39 µs1.78 µs
  • Construction uses deterministic 32-byte leaves for all libraries.
  • rs-merkle receives pre-hashed SHA-256 leaves, matching its public API.
  • Proof size is the serialized proof byte count reported by each library.

Reproduce

git clone https://github.com/1888-Labs/MerkleForge.git
cd MerkleForge
 
# Everything (long: the Patricia insert group alone can take many minutes)
cargo bench --workspace
xdg-open target/criterion/report/index.html   # `open` on macOS
 
# Focused groups
cargo bench --bench hash_throughput
cargo bench --bench binary_tree
cargo bench --bench sparse_tree
cargo bench --bench patricia_trie
cargo bench --bench comparison
cargo bench --bench bench_energy
 
# Print comparative proof sizes
MERKLEFORGE_PRINT_COMPARISON_SIZES=1 cargo bench --bench comparison -- --list

Record the machine, kernel, CPU governor, Rust version, and command next to any numbers you publish. Results are hardware-specific: compare trends across machines, not absolute values.

Reading the tables

  • Latency: time for one operation.
  • Throughput: bytes or elements processed per second.
  • Proof generation: time to produce the witness sent to a verifier.
  • Proof verification: time for a stateless client to check the witness against a trusted root.
  • Proof size: bytes sent over the network or stored as evidence.