Skip to content

feat: criterion benchmarks - #256

Open
saviourmk wants to merge 1 commit into
pluto:mainfrom
saviourmk:feat/criterion-benchmarks
Open

saviourmk wants to merge 1 commit into
pluto:mainfrom
saviourmk:feat/criterion-benchmarks

Conversation

@saviourmk

Copy link
Copy Markdown

This PR closes #205

It changes the following:

Adds criterion benchmarks in benches/, split into three files so you can run one area at a time. hashes covers SHA-256, SHA-512 and SHA3-256 on 64 byte and 1 KiB inputs. symmetric covers AES-128 block encrypt and decrypt, AES-128 CBC on 1 KiB, and ChaCha20 on 1 KiB. algebra covers prime and extension field mul and inverse, curve add and scalar mul, the Tate pairing on the points from the pairing tests, and polynomial mul, DFT, FFT and evaluation. The README has a short section on running them.

I went with criterion only and no nightly #[bench] for now, it works on the pinned toolchain and gives the same output for inner methods and end-to-end runs. Default features are off so it doesn't pull in rayon or plotters. The newest clap needs edition 2024, which the 2024-06 nightly cargo can't parse, so the lockfile pins clap 4.5.20. Nothing else in the lockfile changed apart from the new crates.

They already show a couple of things worth a look, e.g. a prime field inverse takes about 2 µs while an extension field inverse takes about 50 ns, and an AES block takes about 60 µs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: benchmarks

1 participant