golangci-lint icon indicating copy to clipboard operation
golangci-lint copied to clipboard

Speed up packages loading for large projects

Open jirfag opened this issue 5 years ago • 3 comments

In projects like Istio even repeated packages loading takes ~10s. E.g. 8s for Istio. It's important with incremental analysis when 2s we load issues from the cache and 8s load packages. We can cache packages metadata in our file cache and build our own go list implementation using this cache.

jirfag avatar Oct 13 '19 10:10 jirfag

In the setup I'm working with, we're executing GolangCI Lint in a docker image, where the code is mounted into the container. We're finding that linting has become cripplingly slow: often we find that we're hitting the linting deadline of multiple minutes. Note that we're currently using GolangCI Lint 1.19, though I will work at verifying with a more recent version when I can.

Through enabling verbose mode and the loader debugging, I can see that the bulk of the time is spent executing go list (upwards of 2 minutes). This is so long because the docker container has no existing go build cache: if the build cache is pre-initialised beforehand (say by running the same long running go list command before GolangCI Lint has to), then execution is much quicker (though we're still looking at >10s in the projects I'm working on)

dackroyd avatar Mar 30 '20 06:03 dackroyd

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 18 '21 23:04 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 21 '22 05:04 stale[bot]