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

(feature): Benchmarking Poseidon #703

Merged
merged 26 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
309c436
(feature): Benchmark Poseidon
protocolwhisper Nov 29, 2023
0932dcb
(fix): Instantiation Poseidon
protocolwhisper Nov 30, 2023
f60b180
Merge branch 'main' into Poseidon_hash
entropidelic Dec 4, 2023
9c84e6a
(fix): Updating imports
protocolwhisper Dec 6, 2023
8713779
Merge branch 'main' into Poseidon_hash
protocolwhisper Dec 6, 2023
cabb41f
Merge branch 'main' into Poseidon_hash
protocolwhisper Dec 7, 2023
05d3a84
(rebase): Poseidon benchmark
protocolwhisper Dec 15, 2023
e422d94
Merge branch 'lambdaclass:main' into Poseidon_hash
protocolwhisper Dec 15, 2023
8f9b581
Merge branch 'main' into Poseidon_hash
protocolwhisper Dec 18, 2023
4ce2abb
Merge branch 'main' into Poseidon_hash
protocolwhisper Dec 18, 2023
6e5027a
Merge branch 'main' into Poseidon_hash
protocolwhisper Dec 22, 2023
623c238
Merge branch 'main' into Poseidon_hash
protocolwhisper Dec 29, 2023
c36c1b2
Merge branch 'main' into Poseidon_hash
protocolwhisper Dec 29, 2023
c9f26a7
Merge branch 'main' into Poseidon_hash
protocolwhisper Dec 29, 2023
4212142
Merge branch 'lambdaclass:main' into Poseidon_hash
protocolwhisper Jan 3, 2024
ff3cd59
(fix): bench parameters
protocolwhisper Jan 4, 2024
a488de1
(rebase): Fixing fmt error
protocolwhisper Jan 8, 2024
05b657b
Merge branch 'main' into Poseidon_hash
protocolwhisper Jan 8, 2024
c8b7cb9
Merge branch 'main' into Poseidon_hash
diegokingston Jan 8, 2024
39e4d6e
Merge branch 'main' into Poseidon_hash
protocolwhisper Jan 9, 2024
e0164a2
Merge branch 'main' into Poseidon_hash
protocolwhisper Jan 11, 2024
38e5553
Merge branch 'main' into Poseidon_hash
diegokingston Jan 12, 2024
dc41360
Merge branch 'main' into Poseidon_hash
protocolwhisper Jan 26, 2024
d8a21b6
Merge branch 'main' into Poseidon_hash
diegokingston Jan 29, 2024
f29542b
Add missing newline
MauroToscano Jan 29, 2024
dc5583e
Undo removing of a newline
MauroToscano Jan 29, 2024
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
4 changes: 4 additions & 0 deletions crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ harness = false
[[bench]]
name = "iai_merkle"
harness = false

[[bench]]
name= "criterion_poseidon"
harness=false
18 changes: 18 additions & 0 deletions crypto/benches/criterion_poseidon.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use lambdaworks_crypto::hash::poseidon::starknet::PoseidonCairoStark252;
use lambdaworks_crypto::hash::poseidon::Poseidon;
use lambdaworks_math::field::element::FieldElement;
use lambdaworks_math::field::fields::fft_friendly::stark_252_prime_field::Stark252PrimeField;

fn poseidon_benchmarks(c: &mut Criterion) {
let x = FieldElement::<Stark252PrimeField>::from_hex("0x123456").unwrap();
let y = FieldElement::<Stark252PrimeField>::from_hex("0x789101").unwrap();
let mut group = c.benchmark_group("Poseidon Benchmark");

// Benchmark with black_box is 0.41% faster
group.bench_function("Hashing with black_box", |bench| {
bench.iter(|| black_box(PoseidonCairoStark252::hash(&x, &y)))
});
}
criterion_group!(poseidon, poseidon_benchmarks);
criterion_main!(poseidon);
Loading