Skip to content

blake2 code size very high (overuse of#[inline(always)]?) #322

Open
@thomcc

Description

@thomcc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions