Skip to content

Split suboptimal_flops into smaller lints #6867

Open
@HalfVoxel

Description

@HalfVoxel

suboptimal_flops is very useful. Most of its suggestions are wins both for readability and performance, however some significantly reduce readability in my opinion.

E.g.

a * 2.0 + 3.0

is a lot more readable than

a.mul_add(2.0, 3.0)

in particular for new developers that may not be familiar with mul_add.

We'd love to enable suboptimal_flops for our code-base, but there is definitely some friction where it makes suggestions that just makes the code less readable in code that doesn't need the absolute maximum performance.

I propose splitting suboptimal_flops into two smaller lint groups such that one group contains all lints that improve performance and readability, and the other contains those that improve performance, but may impact readability negatively.

Drawbacks

More lint types

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsS-needs-discussionStatus: Needs further discussion before merging or work can be started

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions