Skip to content

perf(dash-pow): X11 slow in unoptimized builds #134

Closed

Description

@ZocoLini

At opt-level 0, X11 takes about 180 us per 80-byte header against 4 us in release, and about 7x slower than the C rs-x11-hash it replaced at opt-level 0. A CPU profile puts about 64% of the time in wide operators and bytemuck casts: they are #[inline], so they are emitted in dash-pow and every SIMD operation becomes a function call. Raising wide's opt-level has no effect, only dash-pow's does, and Cargo ignores the profile overrides of dependencies, so downstream crates get the slow path by default.

Make X11 usable in unoptimized builds.

Reported downstream in dashpay/rust-dashcore#1425.

Activity

  1. ZocoLini commented on Nov 18, 2026

    @ZocoLini
    ContributorAuthor

    After taking a look at the different solutions I could thiunbk about, the best option is to document the issue, and add to the README somehitng like

    Unoptimized builds hash about 45 times slower than release builds. The SIMD code relies on the optimizer to turn each
    vector operation into a single instruction. Optimize `dash-pow` in the root `Cargo.toml` of your workspace.
    
    [profile.dev.package.dash-pow]
    opt-level = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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