Skip to content

#[must_use] for benchmarking components #285

@ggwpez

Description

@ggwpez

Some faulty benchmarks ignore their complexity components as described in #400
To avoid this in the future, we can introduce a #[must_use] for complexity params.
This can obviously only be used in cases where the implementation would be faulty, if they are ignored.

Eg. the following benchmark result must depend on n, otherwise it is faulty:

#[must_use]
let n in 0..100;

for _ in 0..n {
    sleep(1 * SEC);
}

A error could be emitted when a weight is derived that does not depend on a #[must_use] component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.D0-easyCan be fixed primarily by duplicating and adapting code by an intermediate coder.I5-enhancementAn additional feature request.T1-FRAMEThis PR/Issue is related to core FRAME, the framework.

    Type

    No type

    Projects

    Status

    Backlog

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions