Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove poly-benches. #558

Merged
merged 4 commits into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ members = [
"bench-templates",

"poly",
"poly-benches",
"test-curves",
"test-templates",
]
Expand Down
45 changes: 0 additions & 45 deletions poly-benches/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion poly-benches/LICENSE-APACHE

This file was deleted.

1 change: 0 additions & 1 deletion poly-benches/LICENSE-MIT

This file was deleted.

24 changes: 23 additions & 1 deletion poly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,31 @@ derivative = { version = "2", default-features = false, features = [ "use_core"
hashbrown = { version = "0.13.1"}

[dev-dependencies]
ark-test-curves = { path = "../test-curves", default-features = false, features = [ "bls12_381_curve", "bn384_small_two_adicity_curve"] }
ark-test-curves = { path = "../test-curves", default-features = false, features = [ "bls12_381_curve", "bn384_small_two_adicity_curve", "mnt4_753_curve"] }
criterion = "0.4.0"


[features]
default = []
std = [ "ark-std/std", "ark-ff/std" ]
parallel = [ "std", "ark-ff/parallel", "rayon", "ark-std/parallel" ]


[[bench]]
name = "fft"
path = "benches/fft.rs"
harness = false

[[bench]]
name = "dense_uv_polynomial"
path = "benches/dense_uv_polynomial.rs"

[[bench]]
name = "dense_multilinear"
path = "benches/dense_multilinear.rs"
harness = false

[[bench]]
name = "sparse_multilinear"
path = "benches/sparse_multilinear.rs"
harness = false
10 changes: 6 additions & 4 deletions poly-benches/src/lib.rs → poly/benches/common.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
use ark_std::cmp::min;

// Utility function for getting a vector of degrees to benchmark on.
// returns vec![2^{min}, 2^{min + interval}, ..., 2^{max}], where:
// interval = log_interval
// min = ceil(log_2(min_degree))
// max = ceil(log_2(max_degree))
Pratyush marked this conversation as resolved.
Show resolved Hide resolved
pub fn size_range(log_interval: usize, min_degree: usize, max_degree: usize) -> Vec<usize> {
pub fn size_range(
log_interval: usize,
min_degree: usize,
max_degree: usize,
) -> ark_std::vec::Vec<usize> {
let mut to_ret = vec![min_degree.next_power_of_two()];
let interval = 1 << log_interval;
while *to_ret.last().unwrap() < max_degree {
let next_elem = min(max_degree, interval * to_ret.last().unwrap());
let next_elem = usize::min(max_degree, interval * to_ret.last().unwrap());
to_ret.push(next_elem);
}
to_ret
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
extern crate criterion;
mod common;

use ark_ff::{FftField, Field};
use ark_poly::{
polynomial::univariate::{DensePolynomial, SparsePolynomial},
DenseUVPolynomial, EvaluationDomain, GeneralEvaluationDomain, Polynomial,
};
use ark_poly_benches::size_range;
use ark_std::rand::Rng;
use ark_test_curves::bls12_381::Fr as bls12_381_fr;
use common::size_range;
use criterion::{criterion_group, criterion_main, Bencher, BenchmarkId, Criterion};

const BENCHMARK_MIN_DEGREE: usize = 1 << 15;
Expand Down
3 changes: 2 additions & 1 deletion poly-benches/benches/fft.rs → poly/benches/fft.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
extern crate criterion;
mod common;

use ark_ff::FftField;
use ark_poly::{
polynomial::{univariate::DensePolynomial, DenseUVPolynomial},
EvaluationDomain, MixedRadixEvaluationDomain, Radix2EvaluationDomain,
};
use ark_poly_benches::size_range;
use ark_test_curves::{bls12_381::Fr as bls12_381_fr, mnt4_753::Fq as mnt6_753_fr};
use common::size_range;
use criterion::{criterion_group, criterion_main, Bencher, BenchmarkId, Criterion};

// degree bounds to benchmark on
Expand Down