hashes
hashes copied to clipboard
`blake2` code size very high (overuse of`#[inline(always)]`?)
I have ~150kb of code for blake2::blake2b::VarBlake2b::compress under -Copt-level=z, which is around 3x larger than any other function in my binary. It would be nice if it were smaller.
Looking at https://github.com/RustCrypto/hashes/blob/master/blake2/src/blake2.rs, a lot is #[inline(always)], and the round calls are manually unrolled.
There's a good chance these would still get inlined and unrolled on -Copt-level=3 if it were written using #[inline] and a loop, but it would make a big difference to use cases where large code is undesirable.
Note that there's an open PR to completely replace the current implementation: #228