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

Optimized benches and updated PDF that compares the classes performance #44

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Binary file added .DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions .idea/class.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

213 changes: 213 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,24 @@ libc = "0.2.0"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
flame = "0.2.2"
flamer = "0.3"

[dependencies.curv]
git = "https://github.com/KZen-networks/curv"
tag = "v0.2.6"
features = ["ec_secp256k1"]

[dev-dependencies]
criterion = "0.3"


[[bench]]
name = "class_group"
harness = false

[profile.dev]
opt-level = 0

[profile.release]
opt-level = 3
Binary file added ComparisonClassGroups.pdf
Binary file not shown.
30 changes: 30 additions & 0 deletions benches/class_group.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use class_group::*;

/*
pub fn criterion_benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("sampling Exp");
// Configure Criterion.rs to detect smaller differences and increase sample size to improve
// precision and counteract the resulting noise.
group.significance_level(0.1).sample_size(20);
group.bench_function("composing exp", |b| b.iter(|| bench_compose_exp()));
group.finish();
}
*/

pub fn criterion_benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("sampling Exp");
group.significance_level(0.1).sample_size(10);
for exp_size in (1000..7000).step_by(1000) {
let dest = format!("exp 2048 bits by {:?} digits number",exp_size);
group.bench_function(dest, |b| b.iter(|| bench_exp_only_for_a_given_det(black_box(exp_size))));
// group.bench_function(dest, |b| b.iter(|| bench_exp_only(black_box(exp_size))));

}
group.finish();

}


criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);
5 changes: 5 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ use std::process::Command;
fn main() {
let pari_dir = "./depend/pari";
let pari_install = format!("{}/pari", env::var("OUT_DIR").unwrap());
// cd depend/pari
// ./Configure --prefix=/path/to/out
// ./depend/pari/Makefile
// install:
// copy everything to /path/to/out
{
let path = fs::canonicalize(format!("{}/Configure", pari_dir)).unwrap();
let output = Command::new(path.to_str().unwrap())
Expand Down
Loading