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

readme: Add "Performance" section #2

Merged
merged 1 commit into from
Dec 18, 2022
Merged
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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,29 @@ but it was also inspired by the following ones:
* [circomlibjs](https://github.com/iden3/circomlibjs)
* [zero-knowledge-gadgets](https://github.com/webb-tools/zero-knowledge-gadgets)

### Performance

This repository contains a benchmark measuring the performance of this
Poseidon implementation for given two random 32 bytes inputs.

To run them, simply use:

```bash
cargo bench
```

This is the result from a host with the following hardware:

* AMD Ryzen 9 5950x (base clock: 3.4 GHz, up to: 4.9 GHz)
* 4 x Corsair Vengeance DDR4 32GB 3600 MHz

```norust
poseidon_bn253_x5_3 time: [21.980 µs 21.997 µs 22.017 µs]
Found 9 outliers among 100 measurements (9.00%)
4 (4.00%) high mild
5 (5.00%) high severe
```

## License

Licensed under [Apache License, Version 2.0](LICENSE).
Expand Down
23 changes: 23 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,29 @@
//!
//! * [circomlibjs](https://github.com/iden3/circomlibjs)
//! * [zero-knowledge-gadgets](https://github.com/webb-tools/zero-knowledge-gadgets)
//!
//! ## Performance
//!
//! This repository contains a benchmark measuring the performance of this
//! Poseidon implementation for given two random 32 bytes inputs.
//!
//! To run them, simply use:
//!
//! ```bash
//! cargo bench
//! ```
//!
//! This is the result from a host with the following hardware:
//!
//! * AMD Ryzen 9 5950x (base clock: 3.4 GHz, up to: 4.9 GHz)
//! * 4 x Corsair Vengeance DDR4 32GB 3600 MHz
//!
//! ```norust
//! poseidon_bn253_x5_3 time: [21.980 µs 21.997 µs 22.017 µs]
//! Found 9 outliers among 100 measurements (9.00%)
//! 4 (4.00%) high mild
//! 5 (5.00%) high severe
//! ```

use ark_ff::PrimeField;
use thiserror::Error;
Expand Down