-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
5x slower than plain "go vet" with just "govet" enabled #208
Comments
hi! |
Thanks, that solves it. I wonder what the purpose of having this default by |
it's |
I see. I don't ever run with just govet, but I noticed it was a linter that was particularly slow compared to running it manually. What's interesting is that
Is this a problem with |
(I notice that a bunch of linters, like typecheck and megacheck, also don't understand Go modules.) |
it will be solved by #178 |
I'm experiencing this same problem with golangci-lint 1.18.0, but it seems like the |
Don't perform extra go env calls in go/packages. Load only needed go env vars in golangci-lint. Stay in sync by enabled analyzers in go vet: remove nilness and atomicalign analyzers, add errorsas analyzer. Don't build SSA for govet. Standalone govet runs 25% faster than before. All runs can be 5-10% faster than before. Relates: #208
Hi @aaronlehmann , thank you!
|
Don't perform extra go env calls in go/packages. Load only needed go env vars in golangci-lint. Stay in sync by enabled analyzers in go vet: remove nilness and atomicalign analyzers, add errorsas analyzer. Don't build SSA for govet. Standalone govet runs 25% faster than before. All runs can be 5-10% faster than before. Relates: #208
Normally I run many linters, but performance was a lot slower than gometalinter, and I tracked down the difference to Here are some benchmarks showing what I mean:
It's interesting to me that the "system" time is so high. Here is my .golangci.yml:
This made a big difference!
Thank you for looking into this. I consider the issue resolved. |
I'm not sure if it's because of the same change, but peak memory use also seems much lower now. I'm seeing about 3.2 GB, instead of 9 GB before I upgraded. |
If you are running only |
It was finally fixed by using go/analysis facts caching in #699 |
#699 seems to have made things a lot slower. Before:
After:
The first run with the new version was even slower (at least a few minutes), but I didn't manage to capture the timing. Also, memory use is much higher than before. On the first run, I saw it using 15 GB, up from 3.2 GB before. Is there any way to turn offf the facts caching? |
@aaronlehmann I will reopen the issue if it still exists. |
v1.20.0 seems to be only slightly slower than c9a9255, which I was using before (not dramatically slower like just after #699). With v1.20.0 I'm seeing a lot of strange failures that I can't reliably reproduce like |
Good, please make a new issue about these warnings |
golangci-lint seems to have become much slower recently. As a test case, I see that
golangci-lint
withgovet
takes about 6.4 seconds, compared to plaingo vet
at 1.25 seconds.Just with
govet
enabled:Plain
go vet
:Environment:
The text was updated successfully, but these errors were encountered: