Skip to content

Commit

Permalink
digest update time
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ozdemir committed Feb 15, 2024
1 parent b902ebc commit 0585b9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/set_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,12 @@ fn merkle_bench<E: Engine, H: Hasher<F = E::Fr> + CircuitHasher<E = E>>(
let ins = circuit.inputs.as_ref().unwrap();
let mut initial_set = ins.initial_state.clone();
let mut final_set = {
let tt = std::time::Instant::now();
let mut t = initial_set.clone();
t.swap_all(ins.to_remove.clone(), ins.to_insert.clone());
if verbose::in_verbose_mode() {
println!("Digest update time: {}s", tt.elapsed().as_secs_f64());
}
t
};
let inputs: Vec<E::Fr> = vec![initial_set.digest(), final_set.digest()];
Expand Down
2 changes: 1 addition & 1 deletion src/set/int_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ where
};
if in_verbose_mode() {
println!("Done with recomputation");
println!("Digest time: {}s", t.elapsed().as_secs_f64());
println!("Digest update time: {}s", t.elapsed().as_secs_f64());
}
}
self.digest.clone().unwrap()
Expand Down

0 comments on commit 0585b9d

Please sign in to comment.