plonky2/src/bin/bench_field_mul.rs
Daniel Lubarov 018fb005f8
Move stuff around (#135)
No functional changes here. The biggest change was moving certain files into new directories like `plonk` and `iop` (for things like `Challenger` that could be used in STARKs or other IOPs). I also split a few files, renames, etc, but again nothing functional, so I don't think a careful review is necessary (just a sanity check).
2021-07-29 22:00:29 -07:00

28 lines
562 B
Rust

//! Performs a single exponentiation.
use std::time::Instant;
use plonky2::field::crandall_field::CrandallField;
use plonky2::field::field_types::Field;
type F = CrandallField;
const EXPONENT: usize = 1000000000;
fn main() {
let base = F::rand();
let mut state = F::ONE;
let start = Instant::now();
for _ in 0..EXPONENT {
state *= base;
}
let duration = start.elapsed();
println!("Result: {:?}", state);
println!(
"Average field mul: {:?}ns",
duration.as_secs_f64() * 1e9 / EXPONENT as f64
);
}