-
Notifications
You must be signed in to change notification settings - Fork 4
Improve performance of bidichk #43
Copy link
Copy link
Closed
Description
We noticed of all the analyzers we have enabled in golangci-lint, the bidichk one was consuming the most time. This was a bit surprising, but I believe I've identified the reason for the performance issue.
The analyzer is iterating over analysis.Pass.Fset (which contains all imports including the go stdlib and module dependencies) in addition to the files found in the specified packages. It appears it should be updated to only run on analysis.Pass.Files instead.
Additionally, using Fset will mean that for files imported by multiple packages, the analyzer will process the same files multiple times.
After enabling a fix for this locally, the runtime of the analyzer dropped from 76.29s to 4.71s in our moderately sized project.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels