Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong linters load mode #1862

Merged
merged 1 commit into from Mar 21, 2021
Merged

fix: wrong linters load mode #1862

merged 1 commit into from Mar 21, 2021

Conversation

ldez
Copy link
Member

@ldez ldez commented Mar 21, 2021

The LoadMode LoadModeTypesInfo in the goanalysis.Linter says that the linter needs to resolve all the types.

The LoadMode WithLoadForGoAnalysis in the linter.Config says that the linter needs more information about dependencies and sizes.

Each of these loading modes has an impact on how the linter can be executed, how the cache is used, and on the speed.

For example, if a linter uses the LoadMode LoadModeTypesInfo in the goanalysis.Linter, this linter will no be able to analyze a single file with elements not defined in that file.

Another example, the impact of the wrong load mode on the speed of ineffassign:

real user sys
before 2.88 12.71 1.28
after 1.53 4.39 0.64

The loading mode depends on the internal requirements of a linter, it's neither a way to optimize speed nor a way to allow a linter to be executed on a single file.
But if the loading mode is wrong, it has an impact on the capacities and the performance of a linter.

@ldez ldez added bug Something isn't working topic: speed labels Mar 21, 2021
Copy link
Member

@bombsimon bombsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez merged commit 809be02 into golangci:master Mar 21, 2021
@ldez ldez deleted the fix/load-mode branch March 21, 2021 22:06
@ldez ldez added this to the v1.39 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic: speed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants