Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Remove timing printlns (#49)
Browse files Browse the repository at this point in the history
* Remove timing printlns

* Remove unused variables
  • Loading branch information
jfecher authored Feb 1, 2023
1 parent c673a14 commit b734985
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
19 changes: 2 additions & 17 deletions barretenberg_static_lib/src/composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ impl StandardComposer {
}

pub fn create_proof(&mut self, witness: WitnessAssignments) -> Vec<u8> {
let now = std::time::Instant::now();

let cs_buf = self.constraint_system.to_bytes();
let mut proof_addr: *mut u8 = std::ptr::null_mut();
let p_proof = &mut proof_addr as *mut *mut u8;
Expand Down Expand Up @@ -109,11 +107,6 @@ impl StandardComposer {
unsafe {
result = Vec::from_raw_parts(proof_addr, proof_size as usize, proof_size as usize)
}
println!(
"Total Proving time (Rust + Static Lib) : {}ns ~ {}seconds",
now.elapsed().as_nanos(),
now.elapsed().as_secs(),
);
remove_public_inputs(self.constraint_system.public_inputs.len(), result)
}

Expand All @@ -138,23 +131,15 @@ impl StandardComposer {
proof_with_pi.extend(proof);
proof = proof_with_pi;
}
let now = std::time::Instant::now();

let verified;
unsafe {
verified = barretenberg_wrapper::composer::verify(
barretenberg_wrapper::composer::verify(
self.pippenger.pointer(),
&proof,
&self.constraint_system.to_bytes(),
&self.crs.g2_data,
);
)
}
println!(
"Total Verifier time (Rust + Static Lib) : {}ns ~ {}seconds",
now.elapsed().as_nanos(),
now.elapsed().as_secs(),
);
verified
}
}

Expand Down
14 changes: 0 additions & 14 deletions barretenberg_wasm/src/composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ impl StandardComposer {
}

pub fn create_proof(&mut self, witness: WitnessAssignments) -> Vec<u8> {
let now = std::time::Instant::now();

let cs_buf = self.constraint_system.to_bytes();
let cs_ptr = self.barretenberg.allocate(&cs_buf);

Expand Down Expand Up @@ -159,11 +157,6 @@ impl StandardComposer {
proof_ptr as usize,
proof_ptr as usize + proof_size.unwrap_i32() as usize,
);
println!(
"Total Proving time (Rust + WASM) : {}ns ~ {}seconds",
now.elapsed().as_nanos(),
now.elapsed().as_secs(),
);
remove_public_inputs(self.constraint_system.public_inputs.len(), proof)
}

Expand All @@ -189,7 +182,6 @@ impl StandardComposer {
proof_with_pi.extend(proof);
proof = proof_with_pi;
}
let now = std::time::Instant::now();

let cs_buf = self.constraint_system.to_bytes();
let cs_ptr = self.barretenberg.allocate(&cs_buf);
Expand All @@ -216,12 +208,6 @@ impl StandardComposer {
self.barretenberg.free(proof_ptr);
// self.barretenberg.free(g2_ptr);

println!(
"Total Verifier time (Rust + WASM) : {}ns ~ {}seconds",
now.elapsed().as_nanos(),
now.elapsed().as_secs(),
);

match verified.unwrap_i32() {
0 => false,
1 => true,
Expand Down

0 comments on commit b734985

Please sign in to comment.