-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding cache dir, auto switch to manual calc, test & bench
- Loading branch information
Showing
13 changed files
with
331 additions
and
61 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
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,33 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
use rust_kzg_bn254::kzg::Kzg; | ||
use std::time::Duration; | ||
|
||
fn bench_kzg_ifft_cache(c: &mut Criterion) { | ||
let kzg = Kzg::setup( | ||
"tests/test-files/mainnet-data/g1.32mb.point", | ||
"", | ||
"tests/test-files/mainnet-data/g2.point.powerOf2", | ||
268435456, | ||
524288, | ||
"/tmp".to_owned(), | ||
) | ||
.unwrap(); | ||
|
||
c.bench_function("bench_kzg_ifft_cache", |b| { | ||
b.iter(|| kzg.initialize_cache(true).unwrap()); | ||
}); | ||
} | ||
|
||
fn criterion_config() -> Criterion { | ||
Criterion::default() | ||
.warm_up_time(Duration::from_secs(5)) // Warm-up time | ||
.measurement_time(Duration::from_secs(70)) // Measurement time | ||
.sample_size(10) // Number of samples to take | ||
} | ||
|
||
criterion_group!( | ||
name = benches; | ||
config = criterion_config(); | ||
targets = bench_kzg_ifft_cache | ||
); | ||
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 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub const BYTES_PER_FIELD_ELEMENT: usize = 32; | ||
pub const SIZE_OF_G1_AFFINE_COMPRESSED: usize = 32; // in bytes | ||
pub const SIZE_OF_G2_AFFINE_COMPRESSED: usize = 64; // in bytes | ||
pub const REQUIRED_FREE_SPACE: u64 = 100 * 1024 * 1024; // 100 MB in bytes |
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
Oops, something went wrong.