Skip to content

Investigate opportunities to speed-up invariant_booleans. #57575

Closed
@pq

Description

@pq

Looking at the benchmarking bot, invariant_booleans is running considerably longer than other lints.

---------------------------------------------------
Timings                                          ms
---------------------------------------------------
public_member_api_docs                          157
invariant_booleans                              154
close_sinks                                      46
unnecessary_this                                 46

I wonder if there are any remaining opportunities for speed-up?

cc @alexeieleusis

FYI @bwilkerson

Activity

alexeieleusis

alexeieleusis commented on May 22, 2017

@alexeieleusis
Contributor

Back when I started contributing lints I thought about this one because I saw it was the one with more violations in several few big projects like the jdk and some big open source codebases. The experience with the Dart SDK was quite different with very few occurrences and few false positives, within my project there have been only false positives (surprisingly not easy to reproduce). Additionally most of the cases where this verification would be valuable are catched by literal_only_boolean_expression since the errors themselves seem to be "debugging leftovers". Apparently code review catches all of them.

All of this to say that probably this lint should be deprecated or at the very least make is clear that running it in CI (or similar) cycles should be enough to get the value it provides, for instance, in my team we have it disabled for IDE inspection.

I will look into it, but it has previously gone through a couple of cycles like this, so I am not very optimistic we can get much out of it.

pq

pq commented on Jun 22, 2018

@pq
MemberAuthor

FWIW, this one has crept to the top of the "slow lint" list.

image

Not sure if we want to deprecate (and should really track usage) but we should probably tag as slow (once we have support for tags -- #57719).

added
type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
and removed
type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
on Jun 27, 2018
srawlins

srawlins commented on Oct 24, 2022

@srawlins
Member

We've deprecated invariant_booleans and will not be fixing correctness bugs going forward.

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

    P4devexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.linter-false-positivetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)type-performanceIssue relates to performance or code size

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @pq@srawlins@alexeieleusis@devoncarew

        Issue actions

          Investigate opportunities to speed-up `invariant_booleans`. · Issue #57575 · dart-lang/sdk