diff --git a/halo2_proofs/src/arithmetic.rs b/halo2_proofs/src/arithmetic.rs index 99d2ebb893..5cd83de66d 100644 --- a/halo2_proofs/src/arithmetic.rs +++ b/halo2_proofs/src/arithmetic.rs @@ -137,7 +137,7 @@ pub fn best_multiexp(coeffs: &[C::Scalar], bases: &[C]) -> C::Cu //println!("msm: {}", coeffs.len()); - let start = get_time(); + // let start = get_time(); let num_threads = multicore::current_num_threads(); let res = if coeffs.len() > num_threads { let chunk = coeffs.len() / num_threads; @@ -163,11 +163,11 @@ pub fn best_multiexp(coeffs: &[C::Scalar], bases: &[C]) -> C::Cu acc }; - let duration = get_duration(start); + // let duration = get_duration(start); #[allow(unsafe_code)] - unsafe { - MULTIEXP_TOTAL_TIME += duration; - } + // unsafe { + // MULTIEXP_TOTAL_TIME += duration; + // } res } @@ -525,7 +525,7 @@ use rand_core::OsRng; #[cfg(test)] use crate::halo2curves::pasta::Fp; -use crate::plonk::{get_duration, get_time, start_measure, stop_measure}; +// use crate::plonk::{get_duration, get_time, start_measure, stop_measure}; #[test] fn test_lagrange_interpolate() { diff --git a/halo2_proofs/src/dev.rs b/halo2_proofs/src/dev.rs index f9eb16af17..ec2e27ae2e 100644 --- a/halo2_proofs/src/dev.rs +++ b/halo2_proofs/src/dev.rs @@ -6,7 +6,7 @@ use std::fmt; use std::iter; use std::ops::{Add, Mul, Neg, Range}; use std::sync::Arc; -use std::time::{Duration, Instant}; +// use std::time::{Duration, Instant}; use blake2b_simd::blake2b; use ff::Field; diff --git a/halo2_proofs/src/plonk.rs b/halo2_proofs/src/plonk.rs index e3bffc000e..9097b7ef78 100644 --- a/halo2_proofs/src/plonk.rs +++ b/halo2_proofs/src/plonk.rs @@ -45,38 +45,38 @@ pub use verifier::*; use evaluation::Evaluator; use std::env::var; use std::io; -use std::time::Instant; - -/// Temp -#[allow(missing_debug_implementations)] -pub struct MeasurementInfo { - /// Temp - pub measure: bool, - /// Temp - pub time: Instant, - /// Message - pub message: String, - /// Indent - pub indent: usize, -} - -/// TEMP -#[cfg(feature = "profile")] -pub static NUM_INDENT: AtomicUsize = AtomicUsize::new(0); - -/// Temp -pub fn get_time() -> Instant { - Instant::now() -} - -/// Temp -pub fn get_duration(start: Instant) -> usize { - let final_time = Instant::now() - start; - let secs = final_time.as_secs() as usize; - let millis = final_time.subsec_millis() as usize; - let micros = (final_time.subsec_micros() % 1000) as usize; - secs * 1000000 + millis * 1000 + micros -} +// use std::time::Instant; + +// /// Temp +// #[allow(missing_debug_implementations)] +// pub struct MeasurementInfo { +// /// Temp +// pub measure: bool, +// /// Temp +// pub time: Instant, +// /// Message +// pub message: String, +// /// Indent +// pub indent: usize, +// } + +// /// TEMP +// #[cfg(feature = "profile")] +// pub static NUM_INDENT: AtomicUsize = AtomicUsize::new(0); + +// /// Temp +// pub fn get_time() -> Instant { +// Instant::now() +// } + +// /// Temp +// pub fn get_duration(start: Instant) -> usize { +// let final_time = Instant::now() - start; +// let secs = final_time.as_secs() as usize; +// let millis = final_time.subsec_millis() as usize; +// let micros = (final_time.subsec_micros() % 1000) as usize; +// secs * 1000000 + millis * 1000 + micros +// } /// Temp pub fn log_measurement(indent: Option, msg: String, duration: usize) { diff --git a/halo2_proofs/src/poly/domain.rs b/halo2_proofs/src/poly/domain.rs index 0db3f459e1..9fba645791 100644 --- a/halo2_proofs/src/poly/domain.rs +++ b/halo2_proofs/src/poly/domain.rs @@ -4,7 +4,7 @@ use crate::{ arithmetic::{best_fft, parallelize, parallelize_count, FieldExt, Group}, multicore, - plonk::{get_duration, get_time, start_measure, stop_measure, Assigned}, + plonk::{Assigned}, }; use super::{Coeff, ExtendedLagrangeCoeff, LagrangeCoeff, Polynomial, Rotation}; @@ -787,7 +787,7 @@ impl EvaluationDomain { } fn fft_inner(&self, a: &mut Vec, omega: G::Scalar, log_n: u32, inverse: bool) { - let start = get_time(); + // let start = get_time(); if get_fft_mode() == 1 { let fft_data = if a.len() == self.fft_data.n { &self.fft_data @@ -798,12 +798,12 @@ impl EvaluationDomain { } else { best_fft(a, omega, log_n); } - let duration = get_duration(start); + // let duration = get_duration(start); - #[allow(unsafe_code)] - unsafe { - FFT_TOTAL_TIME += duration; - } + // #[allow(unsafe_code)] + // unsafe { + // FFT_TOTAL_TIME += duration; + // } } /// Get the size of the domain @@ -1029,21 +1029,17 @@ fn test_fft() { let num_threads = multicore::current_num_threads(); let mut a = input.clone(); - #[cfg(feature = "profile")] - let start = start_measure(format!("best fft {} ({})", a.len(), num_threads), false); + // let start = start_measure(format!("best fft {} ({})", a.len(), num_threads), false); best_fft(&mut a, domain.omega, k); - #[cfg(feature = "profile")] - stop_measure(start); + // stop_measure(start); - let mut b = input; - #[cfg(feature = "profile")] - let start = start_measure( - format!("recursive fft {} ({})", a.len(), num_threads), - false, - ); + let mut b = input.clone(); + // let start = start_measure( + // format!("recursive fft {} ({})", a.len(), num_threads), + // false, + // ); recursive_fft(&domain.fft_data, &mut b, false); - #[cfg(feature = "profile")] - stop_measure(start); + // stop_measure(start); for i in 0..n { //println!("{}: {} {}", i, a[i], b[i]);