Skip to content

Commit

Permalink
created separate benchmark files
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio95 committed Oct 30, 2023
1 parent dd82dbc commit a029081
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions poly-commit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ derivative = { version = "2", features = [ "use_core" ] }
rayon = { version = "1", optional = true }
hashbrown = { version = "0.14", default-features = false, optional = true }

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

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

[[bench]]
name = "pcs"
path = "benches/pcs.rs"
Expand All @@ -41,6 +51,8 @@ harness = false
ark-ed-on-bls12-381 = { version = "^0.4.0", default-features = false }
ark-bls12-381 = { version = "^0.4.0", default-features = false, features = [ "curve" ] }
ark-bls12-377 = { version = "^0.4.0", default-features = false, features = [ "curve" ] }
ark-bn254 = { version = "^0.4.0", default-features = false, features = [ "curve" ] }

rand_chacha = { version = "0.3.0", default-features = false }
ark-pcs-bench-templates = { path = "../bench-templates" }

Expand Down
26 changes: 26 additions & 0 deletions poly-commit/benches/hyrax_times.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use ark_ec::AffineRepr;
use ark_pcs_bench_templates::*;
use ark_poly::{DenseMultilinearExtension, MultilinearExtension};

use ark_crypto_primitives::sponge::poseidon::PoseidonSponge;
use ark_bn254::{Fr, G1Affine};
use ark_ff::PrimeField;
use ark_poly::univariate::DensePolynomial as DenseUnivariatePoly;
use ark_poly_commit::ipa_pc::InnerProductArgPC;

use rand_chacha::ChaCha20Rng;

type UniPoly = DenseUnivariatePoly<Fr>;
type Sponge = PoseidonSponge<<EdwardsAffine as AffineRepr>::ScalarField>;

// Hyrax PCS over BN254
type Hyrax254 = HyraxPC<G1Affine, DenseMultilinearExtension<Fr>>;

fn rand_poly_hyrax<F: PrimeField>(num_vars: usize, rng: &mut ChaCha20Rng) -> DenseMultilinearExtension<F> {
DenseMultilinearExtension::rand(num_vars, rng)
}

const MIN_NUM_VARS: usize = 10;
const MAX_NUM_VARS: usize = 20;

bench!(Hyrax254, rand_poly_hyrax);
File renamed without changes.

0 comments on commit a029081

Please sign in to comment.