Skip to content

Tracking issue: SIMD optimizations for double-sha256 on 64 byte inputs #5540

@jrakibi

Description

@jrakibi

Creating this issue to track the remaining work to optimize sha256 and to optimize double-sha256 for 64-byte inputs, and to get approval/feedback before I start working on these improvements


Core reports a ~2.5×–6.5× speedup in merkle root computation for 9001 leaves when using 2/4/8-way SIMD optimizations: bitcoin/bitcoin#13191

Basically what we need is to:

Add SIMD optimizaion for architecture without SHA acceleration:

  • Add 4-way SSE4.1 implementation for double-sha256 on 64 byte inputs
  • Add 8-way AVX2 implementation for double-sha256 on 64-byte inputs

Support ARM and optimize both SHA-NI and SHA2 for 2-way:

(Side note: I built this tool last week, it may help anyone who wants to learn and review these PRs (the one already opened + upcoming ones if we decide to go forward with this) understand the internals of SHA-256 https://github.com/bitcoin-dev-project/hashes-visualizer )

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