-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'microsoft/main' into antonio-cesar/less…
…-than
- Loading branch information
Showing
7 changed files
with
43 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
extern crate core; | ||
|
||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
use ff::Field; | ||
use pasta_curves::Fp; | ||
|
||
use spartan2::spartan::polys::eq::EqPolynomial; | ||
|
||
fn benchmarks_evaluate_incremental(c: &mut Criterion) { | ||
let mut group = c.benchmark_group("evaluate_incremental"); | ||
(1..=20).step_by(2).for_each(|i| { | ||
let random_point: Vec<Fp> = (0..2usize.pow(i)) | ||
.map(|_| Fp::random(&mut rand::thread_rng())) | ||
.collect(); | ||
let random_polynomial = EqPolynomial::new( | ||
(0..2usize.pow(i)) | ||
.map(|_| Fp::random(&mut rand::thread_rng())) | ||
.collect(), | ||
); | ||
group.bench_with_input(format!("2^{}", i), &i, |b, &_i| { | ||
b.iter(|| { | ||
random_polynomial.evaluate(random_point.as_slice()); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
criterion_group!(benches, benchmarks_evaluate_incremental); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters