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

Please clarify if sha1 and sha256 benchmarks used sha-ni extensions #53

Closed
joshtriplett opened this issue Feb 3, 2020 · 3 comments
Closed

Comments

@joshtriplett
Copy link

joshtriplett commented Feb 3, 2020

I'd love to get some more information on the methodology used to produce the benchmark data in the README. In particular, which sha1 and sha256 implementations did you benchmark against, and what hardware extensions did those implementations support?

Thank you for the incredible work on BLAKE3; I'm looking forward to using it, especially the parallel hashing support.

@oconnor663
Copy link
Member

oconnor663 commented Feb 3, 2020

Those were done using OpenSSL on an AWS c5.metal instance (the same instance used to generate Figure 3 in the spec), which does not support the Intel SHA Extensions. You can see the script that generates that chart here: https://github.com/BLAKE3-team/BLAKE3-specs/blob/master/benchmarks/bar_chart.py

The data points are hardcoded into the script, but there's a comment in there mentioning how they were derived. You can clone that repo and run benchmarks like this:

git clone https://github.com/BLAKE3-team/BLAKE3-specs
cd BLAKE3-specs/benchmarks
cargo bench 16384

Unfortunately, that's going to run benchmarks for both 16484 and 163840 bytes. I don't know any way to skip the latter, other than by going into BLAKE3-specs/benchmarks/benches/bench.rs and setting both MIN_LEN and MAX_LEN to 16384 by hand.

As noted in bar_chart.py, if you run BLAKE2 benchmarks on an AVX-512 system, you won't get AVX-512 instructions unless you set RUSTFLAGS="-C target-cpu=native. However, the BLAKE3 implementation does include AVX-512 support, via the c_avx512 feature (which this set of benchmarks enables).

@joshtriplett
Copy link
Author

@oconnor663 Thank you, I appreciate the explanation. OpenSSL's implementations seem like a fine choice.

Would you consider mentioning the use of OpenSSL near your mention of using a c5.metal instance, close to the chart itself?

@oconnor663
Copy link
Member

Added a link to the bar_chart.py script that generated that image, and expanded the comments in there to make it easier to reproduce.

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

No branches or pull requests

2 participants