Skip to content

Commit 45e888d

Browse files
committed
perf(wallet): only do extra MSMP verification in debug mode
This small change gives a 2x speedup on the wallet-updating process, as evidenced by the wallet-state update benchmark which.i **Before this commit** Timer precision: 20 ns wallet_state fastest │ slowest │ median │ mean │ samples │ iters ╰─ maintain_membership_proofs │ │ │ │ │ ╰─ maintain_100_100 │ │ │ │ │ ╰─ apply_block2 172.2 ms │ 184.5 ms │ 175.6 ms │ 176.2 ms │ 10 │ 10 **After this commit** Timer precision: 20 ns wallet_state fastest │ slowest │ median │ mean │ samples │ iters ╰─ maintain_membership_proofs │ │ │ │ │ ╰─ maintain_100_100 │ │ │ │ │ ╰─ apply_block2 91.05 ms │ 102.8 ms │ 91.97 ms │ 92.91 ms │ 10 │ 10
1 parent 8b9418a commit 45e888d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util_types/mutator_set/ms_membership_proof.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl MsMembershipProof {
9898
"Function must be called with same number of membership proofs and items. Got {} items and {} membership proofs", own_items.len(), membership_proofs.len()
9999
);
100100

101-
assert!(membership_proofs
101+
debug_assert!(membership_proofs
102102
.iter()
103103
.all(|msmp| msmp
104104
.target_chunks

0 commit comments

Comments
 (0)