From d172614d0b83f3136293e27c148acdb3467349c9 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Sun, 18 Dec 2022 14:47:59 +0100 Subject: [PATCH] readme: Add "Performance" section Signed-off-by: Michal Rostecki --- README.md | 23 +++++++++++++++++++++++ src/lib.rs | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/README.md b/README.md index c4e1dc0..7027d2d 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/src/lib.rs b/src/lib.rs index de844c6..223a93f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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;