Skip to content

lint long chains of into/float additions/multiplications #1243

Open
@llogiq

Description

@llogiq

In generall, (a+b+c)+(d+e+f) is faster to compute than a+b+c+d+e+f, because the former reduces data dependencies, allowing the CPU to run additions in parallel. For float arithmetic, the tree-like addition may improve numerical stability. Suggest inserting parenthesis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-perfLint: Belongs in the perf lint groupT-ASTType: Requires working with the ASTgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions