golangci / golangci-lint

Fast linters runner for Go
https://golangci-lint.run
GNU General Public License v3.0
15.74k stars 1.39k forks source link

Using more cores makes golangci-lint run slower (?) #5149

Open njern opened 1 day ago

njern commented 1 day ago

Welcome

Description of the problem

I noticed that both when running a "clean" and a "cached" golangci-lint, setting the core limit lower (with the -j option) seems to improve performance, to a point. It is especially noticeable for cached linting runs.

I first noticed this in our own internal repository but I have reproduced it using the golangci-lint repo.

All these commands were run on a Macbook Pro M4 Max (where golangci-lint defaults to using 16 cores).

cache time
default no cache 32.555855417s
-j 4 no cache 29.854271375s
default cache 2.155626167s
-j 4 cache 1.69703725s
golangci-lint run -v (after golangci-lint cache clean) ``` INFO golangci-lint has version 1.62.0 built with go1.23.3 from 22b58c9 on 2024-11-10T13:53:08Z INFO [config_reader] Config search paths: [./ /Users/njern/github/golangci-lint /Users/njern/github /Users/njern /Users /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 36 linters: [bodyclose copyloopvar depguard dogsled dupl errcheck errorlint funlen gocheckcompilerdirectives gochecknoinits goconst gocritic gocyclo godox gofmt goimports goprintffuncname gosec gosimple govet ineffassign intrange lll misspell mnd nakedret noctx nolintlint revive staticcheck stylecheck testifylint unconvert unparam unused whitespace] INFO [loader] Go packages loading at mode 8767 (types_sizes|compiled_files|exports_file|name|deps|files|imports) took 1.96276675s INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 44.92375ms INFO [linters_context/goanalysis] analyzers took 9m25.254223478s with top 10 stages: gocritic: 6m25.524121759s, buildir: 53.260698388s, goimports: 15.812139791s, dupl: 9.018300673s, the_only_name: 7.497279206s, unconvert: 6.270554796s, ctrlflow: 3.958757812s, fact_deprecated: 3.670158088s, printf: 3.645607995s, gosec: 2.984542789s INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/robustio by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/mmap by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/testenv by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir test/testdata_etc/abspath by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 1 issues from dir test/testdata_etc/unused_exported/lib by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 112 issues from dir internal/go/cache by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/quoted by pattern internal/go INFO [runner] Issues before processing: 510, after processing: 0 INFO [runner] Processors filtering stat (in/out): filename_unadjuster: 510/510, invalid_issue: 510/510, skip_dirs: 510/384, exclude: 384/384, identifier_marker: 384/384, skip_files: 510/510, cgo: 510/510, path_prettifier: 510/510, autogenerated_exclude: 384/384, exclude-rules: 384/68, nolint: 68/0 INFO [runner] processing took 18.164126ms with stages: exclude-rules: 6.558334ms, autogenerated_exclude: 3.532374ms, nolint: 2.844458ms, identifier_marker: 2.691625ms, path_prettifier: 1.879708ms, skip_dirs: 602.499µs, invalid_issue: 23.958µs, cgo: 18.667µs, filename_unadjuster: 10.499µs, max_same_issues: 542ns, fixer: 292ns, skip_files: 209ns, uniq_by_line: 209ns, exclude: 209ns, sort_results: 167ns, max_from_linter: 125ns, max_per_file_from_linter: 84ns, source_code: 83ns, path_shortener: 42ns, diff: 42ns, path_prefixer: 0s, severity-rules: 0s INFO [runner] linters took 30.540269417s with stages: goanalysis_metalinter: 30.522071875s INFO File cache stats: 426 entries of total size 917.5KiB INFO Memory: 325 samples, avg is 2235.9MB, max is 3410.6MB INFO Execution took 32.555855417s ```
golangci-lint run -v -j 4 (after golangci-lint cache clean) ``` INFO golangci-lint has version 1.62.0 built with go1.23.3 from 22b58c9 on 2024-11-10T13:53:08Z INFO [config_reader] Config search paths: [./ /Users/njern/github/golangci-lint /Users/njern/github /Users/njern /Users /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 36 linters: [bodyclose copyloopvar depguard dogsled dupl errcheck errorlint funlen gocheckcompilerdirectives gochecknoinits goconst gocritic gocyclo godox gofmt goimports goprintffuncname gosec gosimple govet ineffassign intrange lll misspell mnd nakedret noctx nolintlint revive staticcheck stylecheck testifylint unconvert unparam unused whitespace] INFO [loader] Go packages loading at mode 8767 (files|imports|name|compiled_files|deps|exports_file|types_sizes) took 1.411180584s INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 9.101208ms INFO [linters_context/goanalysis] analyzers took 2m47.626802207s with top 10 stages: gocritic: 1m28.24865404s, buildir: 18.871015413s, goimports: 11.128155453s, dupl: 7.046515498s, the_only_name: 6.109316217s, unconvert: 5.979380999s, fact_deprecated: 1.10383392s, printf: 1.040706755s, inspect: 946.219155ms, gofmt: 928.399373ms INFO [runner/skip_dirs] Skipped 112 issues from dir internal/go/cache by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/quoted by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/robustio by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/mmap by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/testenv by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir test/testdata_etc/abspath by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 1 issues from dir test/testdata_etc/unused_exported/lib by pattern test/testdata_etc INFO [runner] Issues before processing: 510, after processing: 0 INFO [runner] Processors filtering stat (in/out): filename_unadjuster: 510/510, path_prettifier: 510/510, exclude-rules: 384/68, nolint: 68/0, autogenerated_exclude: 384/384, identifier_marker: 384/384, exclude: 384/384, cgo: 510/510, invalid_issue: 510/510, skip_files: 510/510, skip_dirs: 510/384 INFO [runner] processing took 16.580957ms with stages: exclude-rules: 6.523333ms, nolint: 2.763708ms, identifier_marker: 2.504375ms, autogenerated_exclude: 2.314209ms, path_prettifier: 1.828168ms, skip_dirs: 592.249µs, invalid_issue: 24.751µs, cgo: 19.208µs, filename_unadjuster: 9.583µs, max_same_issues: 291ns, fixer: 208ns, sort_results: 208ns, skip_files: 125ns, uniq_by_line: 125ns, exclude: 84ns, diff: 83ns, source_code: 83ns, max_from_linter: 82ns, severity-rules: 42ns, path_shortener: 42ns, max_per_file_from_linter: 0s, path_prefixer: 0s INFO [runner] linters took 28.425245709s with stages: goanalysis_metalinter: 28.408623375s INFO File cache stats: 426 entries of total size 917.5KiB INFO Memory: 295 samples, avg is 1534.9MB, max is 2623.2MB INFO Execution took 29.854271375s ```
golangci-lint run -v (with cache) Ran this five times, execution time ranged between 2,14s and 2,37s. ``` INFO golangci-lint has version 1.62.0 built with go1.23.3 from 22b58c9 on 2024-11-10T13:53:08Z INFO [config_reader] Config search paths: [./ /Users/njern/github/golangci-lint /Users/njern/github /Users/njern /Users /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 36 linters: [bodyclose copyloopvar depguard dogsled dupl errcheck errorlint funlen gocheckcompilerdirectives gochecknoinits goconst gocritic gocyclo godox gofmt goimports goprintffuncname gosec gosimple govet ineffassign intrange lll misspell mnd nakedret noctx nolintlint revive staticcheck stylecheck testifylint unconvert unparam unused whitespace] INFO [loader] Go packages loading at mode 8767 (files|name|types_sizes|compiled_files|exports_file|deps|imports) took 1.206394916s INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 41.323542ms INFO [linters_context/goanalysis] analyzers took 0s with no stages INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/quoted by pattern internal/go INFO [runner/skip_dirs] Skipped 1 issues from dir test/testdata_etc/unused_exported/lib by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/robustio by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir test/testdata_etc/abspath by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/mmap by pattern internal/go INFO [runner/skip_dirs] Skipped 112 issues from dir internal/go/cache by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/testenv by pattern internal/go INFO [runner] Issues before processing: 510, after processing: 0 INFO [runner] Processors filtering stat (in/out): invalid_issue: 510/510, autogenerated_exclude: 384/384, nolint: 68/0, path_prettifier: 510/510, skip_files: 510/510, exclude: 384/384, cgo: 510/510, exclude-rules: 384/68, filename_unadjuster: 510/510, skip_dirs: 510/384, identifier_marker: 384/384 INFO [runner] processing took 16.535252ms with stages: exclude-rules: 6.445667ms, nolint: 2.803958ms, identifier_marker: 2.499625ms, autogenerated_exclude: 2.429708ms, path_prettifier: 1.753499ms, skip_dirs: 551.959µs, invalid_issue: 24.667µs, cgo: 18.334µs, filename_unadjuster: 5.459µs, max_same_issues: 750ns, fixer: 292ns, sort_results: 209ns, diff: 209ns, skip_files: 208ns, max_from_linter: 167ns, exclude: 166ns, uniq_by_line: 125ns, source_code: 125ns, path_shortener: 83ns, severity-rules: 42ns, max_per_file_from_linter: 0s, path_prefixer: 0s INFO [runner] linters took 899.719083ms with stages: goanalysis_metalinter: 883.152667ms INFO File cache stats: 0 entries of total size 0B INFO Memory: 23 samples, avg is 54.1MB, max is 93.8MB INFO Execution took 2.155626167s ```
golangci-lint run -v -j 4 (with cache) Also ran this five times, execution time ranged from 1,43s to 1,69s ``` INFO golangci-lint has version 1.62.0 built with go1.23.3 from 22b58c9 on 2024-11-10T13:53:08Z INFO [config_reader] Config search paths: [./ /Users/njern/github/golangci-lint /Users/njern/github /Users/njern /Users /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 36 linters: [bodyclose copyloopvar depguard dogsled dupl errcheck errorlint funlen gocheckcompilerdirectives gochecknoinits goconst gocritic gocyclo godox gofmt goimports goprintffuncname gosec gosimple govet ineffassign intrange lll misspell mnd nakedret noctx nolintlint revive staticcheck stylecheck testifylint unconvert unparam unused whitespace] INFO [loader] Go packages loading at mode 8767 (compiled_files|deps|files|types_sizes|exports_file|imports|name) took 1.38926575s INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 9.9845ms INFO [linters_context/goanalysis] analyzers took 0s with no stages INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/quoted by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/mmap by pattern internal/go INFO [runner/skip_dirs] Skipped 112 issues from dir internal/go/cache by pattern internal/go INFO [runner/skip_dirs] Skipped 1 issues from dir test/testdata_etc/unused_exported/lib by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/testenv by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/robustio by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir test/testdata_etc/abspath by pattern test/testdata_etc INFO [runner] Issues before processing: 510, after processing: 0 INFO [runner] Processors filtering stat (in/out): identifier_marker: 384/384, exclude-rules: 384/68, invalid_issue: 510/510, path_prettifier: 510/510, skip_dirs: 510/384, autogenerated_exclude: 384/384, cgo: 510/510, exclude: 384/384, filename_unadjuster: 510/510, skip_files: 510/510, nolint: 68/0 INFO [runner] processing took 16.082209ms with stages: exclude-rules: 6.301083ms, identifier_marker: 2.826209ms, nolint: 2.734626ms, autogenerated_exclude: 1.970082ms, path_prettifier: 1.677959ms, skip_dirs: 533.166µs, cgo: 17.167µs, invalid_issue: 14.917µs, filename_unadjuster: 4.667µs, max_same_issues: 792ns, diff: 249ns, sort_results: 209ns, fixer: 209ns, skip_files: 207ns, max_from_linter: 166ns, uniq_by_line: 125ns, source_code: 84ns, severity-rules: 83ns, path_shortener: 83ns, path_prefixer: 42ns, max_per_file_from_linter: 42ns, exclude: 42ns INFO [runner] linters took 289.921334ms with stages: goanalysis_metalinter: 273.804875ms INFO File cache stats: 0 entries of total size 0B INFO Memory: 18 samples, avg is 38.0MB, max is 100.3MB INFO Execution took 1.69703725s ```

Version of golangci-lint

```console $ golangci-lint --version golangci-lint has version 1.62.0 built with go1.23.3 from 22b58c9 on 2024-11-10T13:53:08Z``` ```

Configuration

```console # paste configuration file or CLI flags here ```

Go environment

```console $ go version && go env go version go1.23.3 darwin/arm64 GO111MODULE='' GOARCH='arm64' GOBIN='' GOCACHE='/Users/njern/Library/Caches/go-build' GOENV='/Users/njern/Library/Application Support/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOINSECURE='' GOMODCACHE='/Users/njern/go/pkg/mod' GOOS='darwin' GOPATH='/Users/njern/go' GOPROXY='https://proxy.golang.org,direct' GOROOT='/opt/homebrew/Cellar/go/1.23.3/libexec' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='local' GOTOOLDIR='/opt/homebrew/Cellar/go/1.23.3/libexec/pkg/tool/darwin_arm64' GOVCS='' GOVERSION='go1.23.3' GODEBUG='' GOTELEMETRY='local' GOTELEMETRYDIR='/Users/njern/Library/Application Support/go/telemetry' GCCGO='gccgo' GOARM64='v8.0' AR='ar' CC='cc' CXX='c++' CGO_ENABLED='1' GOMOD='/Users/njern/github/golangci-lint/go.mod' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/23/rl5hsyxx4klg_9_7l2ymybp00000gn/T/go-build4225367625=/tmp/go-build -gno-record-gcc-switches -fno-common'```

Validation

Supporter

boring-cyborg[bot] commented 1 day ago

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

ldez commented 1 day ago

Hello,

In some cases using all the cores doesn't provide the best performance, this is not unexpected because the CPU is one of the limits of a system when using parallel processes.

I think it's because we are hitting other limitations than the CPU related to concurrency access (memory, FS, other processes, etc.).

But as you can see the "best" value for the CPU depends on the system, so it's not possible to do something smart on this topic.

cache time
default no cache 23.078625285s
-j 4 no cache 39.784760618s
-j 6 no cache 28.895793532s
default cache 1.026388844s
-j 4 cache 1.047746156s
-j 6 cache 967.3105ms

I also have 16 cores, but on Linux amd64.

Also, the cache is not a global thing for golangci-lint, I mean it's not "all or nothing" because the cache is by package, and the invalidation of cache is by package too. Due to that, it's not possible, from the POV of golangci-lint, to really know if there is a cache, and these benchmarks should be evaluated carefully.


default, no cache ```console $ golangci-lint cache clean; golangci-lint run -v INFO golangci-lint has version 1.62.0 built with go1.23.2 from 22b58c9b on 2024-11-10T19:09:02Z INFO [config_reader] Config search paths: [./ /home/ldez/sources/golangci/golangci-lint /home/ldez/sources/golangci /home/ldez/sources /home/ldez /home /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 36 linters: [bodyclose copyloopvar depguard dogsled dupl errcheck errorlint funlen gocheckcompilerdirectives gochecknoinits goconst gocritic gocyclo godox gofmt goimports goprintffuncname gosec gosimple govet ineffassign intrange lll misspell mnd nakedret noctx nolintlint revive staticcheck stylecheck testifylint unconvert unparam unused whitespace] INFO [loader] Go packages loading at mode 8767 (files|types_sizes|compiled_files|deps|exports_file|imports|name) took 1.732099451s INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 37.73902ms INFO [linters_context/goanalysis] analyzers took 5m57.225474923s with top 10 stages: gocritic: 3m46.436341339s, buildir: 57.424044053s, goimports: 5.330305363s, dupl: 3.311811385s, the_only_name: 2.446353019s, unconvert: 2.172881869s, inspect: 2.003145912s, ctrlflow: 1.993345694s, printf: 1.992951633s, fact_deprecated: 1.64308803s INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/quoted by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/robustio by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/testenv by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/mmap by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir test/testdata_etc/abspath by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 1 issues from dir test/testdata_etc/unused_exported/lib by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 112 issues from dir internal/go/cache by pattern internal/go INFO [runner] Issues before processing: 510, after processing: 0 INFO [runner] Processors filtering stat (in/out): skip_dirs: 510/384, exclude: 384/384, path_prettifier: 510/510, cgo: 510/510, filename_unadjuster: 510/510, identifier_marker: 384/384, invalid_issue: 510/510, skip_files: 510/510, autogenerated_exclude: 384/384, exclude-rules: 384/68, nolint: 68/0 INFO [runner] processing took 66.981558ms with stages: autogenerated_exclude: 19.282449ms, exclude-rules: 18.039587ms, path_prettifier: 12.818189ms, nolint: 7.795339ms, identifier_marker: 7.305769ms, skip_dirs: 1.660043ms, cgo: 35.439µs, invalid_issue: 24.406µs, filename_unadjuster: 10.035µs, max_same_issues: 4.352µs, uniq_by_line: 1.267µs, max_from_linter: 1.092µs, skip_files: 843ns, fixer: 677ns, exclude: 639ns, sort_results: 338ns, diff: 279ns, max_per_file_from_linter: 227ns, source_code: 174ns, severity-rules: 173ns, path_shortener: 129ns, path_prefixer: 112ns INFO [runner] linters took 21.30504619s with stages: goanalysis_metalinter: 21.237903708s INFO File cache stats: 425 entries of total size 915.0KiB INFO Memory: 229 samples, avg is 2257.2MB, max is 4096.9MB INFO Execution took 23.078625285s ```
-j 4, no cache ```console $ golangci-lint cache clean; golangci-lint run -v -j 4 INFO golangci-lint has version 1.62.0 built with go1.23.2 from 22b58c9b on 2024-11-10T19:09:02Z INFO [config_reader] Config search paths: [./ /home/ldez/sources/golangci/golangci-lint /home/ldez/sources/golangci /home/ldez/sources /home/ldez /home /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 36 linters: [bodyclose copyloopvar depguard dogsled dupl errcheck errorlint funlen gocheckcompilerdirectives gochecknoinits goconst gocritic gocyclo godox gofmt goimports goprintffuncname gosec gosimple govet ineffassign intrange lll misspell mnd nakedret noctx nolintlint revive staticcheck stylecheck testifylint unconvert unparam unused whitespace] INFO [loader] Go packages loading at mode 8767 (types_sizes|compiled_files|exports_file|files|imports|deps|name) took 1.727325982s INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 15.788824ms INFO [linters_context/goanalysis] analyzers took 3m0.18741501s with top 10 stages: gocritic: 1m53.226397463s, buildir: 31.889571815s, goimports: 5.636113439s, dupl: 5.541761763s, the_only_name: 4.84472518s, unconvert: 4.202925337s, fact_deprecated: 1.058907669s, inspect: 1.040574396s, printf: 769.004304ms, ctrlflow: 672.834358ms INFO [runner/skip_dirs] Skipped 1 issues from dir test/testdata_etc/unused_exported/lib by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 112 issues from dir internal/go/cache by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/quoted by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/robustio by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/testenv by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/mmap by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir test/testdata_etc/abspath by pattern test/testdata_etc INFO [runner] Issues before processing: 510, after processing: 0 INFO [runner] Processors filtering stat (in/out): cgo: 510/510, exclude: 384/384, filename_unadjuster: 510/510, invalid_issue: 510/510, identifier_marker: 384/384, exclude-rules: 384/68, autogenerated_exclude: 384/384, path_prettifier: 510/510, skip_files: 510/510, skip_dirs: 510/384, nolint: 68/0 INFO [runner] processing took 22.537614ms with stages: exclude-rules: 9.761359ms, nolint: 4.937221ms, identifier_marker: 3.499617ms, path_prettifier: 2.08714ms, autogenerated_exclude: 1.407552ms, skip_dirs: 779.621µs, cgo: 31.048µs, invalid_issue: 21.607µs, filename_unadjuster: 9.155µs, max_same_issues: 982ns, skip_files: 301ns, uniq_by_line: 295ns, fixer: 273ns, diff: 272ns, max_from_linter: 203ns, exclude: 201ns, sort_results: 185ns, source_code: 168ns, severity-rules: 152ns, max_per_file_from_linter: 95ns, path_prefixer: 84ns, path_shortener: 83ns INFO [runner] linters took 38.037171283s with stages: goanalysis_metalinter: 38.014575542s INFO File cache stats: 425 entries of total size 915.0KiB INFO Memory: 366 samples, avg is 1539.6MB, max is 2797.9MB INFO Execution took 39.784760618s ```
-j 4, cache ```console $ golangci-lint cache clean; golangci-lint run -j 4; golangci-lint run -v -j 4 INFO golangci-lint has version 1.62.0 built with go1.23.2 from 22b58c9b on 2024-11-10T19:09:02Z INFO [config_reader] Config search paths: [./ /home/ldez/sources/golangci/golangci-lint /home/ldez/sources/golangci /home/ldez/sources /home/ldez /home /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 36 linters: [bodyclose copyloopvar depguard dogsled dupl errcheck errorlint funlen gocheckcompilerdirectives gochecknoinits goconst gocritic gocyclo godox gofmt goimports goprintffuncname gosec gosimple govet ineffassign intrange lll misspell mnd nakedret noctx nolintlint revive staticcheck stylecheck testifylint unconvert unparam unused whitespace] INFO [loader] Go packages loading at mode 8767 (compiled_files|exports_file|name|types_sizes|deps|files|imports) took 744.660194ms INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 11.895893ms INFO [linters_context/goanalysis] analyzers took 0s with no stages INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/robustio by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/mmap by pattern internal/go INFO [runner/skip_dirs] Skipped 1 issues from dir test/testdata_etc/unused_exported/lib by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/testenv by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir test/testdata_etc/abspath by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 112 issues from dir internal/go/cache by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/quoted by pattern internal/go INFO [runner] Issues before processing: 510, after processing: 0 INFO [runner] Processors filtering stat (in/out): skip_dirs: 510/384, nolint: 68/0, filename_unadjuster: 510/510, invalid_issue: 510/510, path_prettifier: 510/510, autogenerated_exclude: 384/384, exclude: 384/384, cgo: 510/510, identifier_marker: 384/384, skip_files: 510/510, exclude-rules: 384/68 INFO [runner] processing took 24.748996ms with stages: exclude-rules: 11.656569ms, nolint: 4.604246ms, identifier_marker: 3.737341ms, path_prettifier: 2.467792ms, autogenerated_exclude: 1.339074ms, skip_dirs: 850.406µs, invalid_issue: 52.617µs, cgo: 28.406µs, filename_unadjuster: 9.422µs, max_same_issues: 837ns, fixer: 314ns, uniq_by_line: 297ns, skip_files: 288ns, max_from_linter: 232ns, exclude: 220ns, sort_results: 208ns, diff: 192ns, source_code: 147ns, max_per_file_from_linter: 111ns, severity-rules: 106ns, path_shortener: 88ns, path_prefixer: 83ns INFO [runner] linters took 287.588367ms with stages: goanalysis_metalinter: 262.776579ms INFO File cache stats: 0 entries of total size 0B INFO Memory: 12 samples, avg is 46.6MB, max is 109.0MB INFO Execution took 1.047746156s ```
default, no cache ```console $ golangci-lint cache clean; golangci-lint run; golangci-lint run -v INFO golangci-lint has version 1.62.0 built with go1.23.2 from 22b58c9b on 2024-11-10T19:09:02Z INFO [config_reader] Config search paths: [./ /home/ldez/sources/golangci/golangci-lint /home/ldez/sources/golangci /home/ldez/sources /home/ldez /home /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 36 linters: [bodyclose copyloopvar depguard dogsled dupl errcheck errorlint funlen gocheckcompilerdirectives gochecknoinits goconst gocritic gocyclo godox gofmt goimports goprintffuncname gosec gosimple govet ineffassign intrange lll misspell mnd nakedret noctx nolintlint revive staticcheck stylecheck testifylint unconvert unparam unused whitespace] INFO [loader] Go packages loading at mode 8767 (types_sizes|compiled_files|deps|exports_file|files|imports|name) took 740.435398ms INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 8.066134ms INFO [linters_context/goanalysis] analyzers took 0s with no stages INFO [runner/skip_dirs] Skipped 1 issues from dir test/testdata_etc/unused_exported/lib by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/robustio by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/testenv by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir test/testdata_etc/abspath by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/mmap by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/quoted by pattern internal/go INFO [runner/skip_dirs] Skipped 112 issues from dir internal/go/cache by pattern internal/go INFO [runner] Issues before processing: 510, after processing: 0 INFO [runner] Processors filtering stat (in/out): filename_unadjuster: 510/510, skip_files: 510/510, skip_dirs: 510/384, identifier_marker: 384/384, exclude: 384/384, invalid_issue: 510/510, nolint: 68/0, path_prettifier: 510/510, autogenerated_exclude: 384/384, exclude-rules: 384/68, cgo: 510/510 INFO [runner] processing took 28.226385ms with stages: exclude-rules: 13.112296ms, nolint: 5.037033ms, identifier_marker: 4.501248ms, path_prettifier: 2.731537ms, autogenerated_exclude: 1.691337ms, skip_dirs: 1.049224ms, cgo: 52.742µs, invalid_issue: 32.334µs, filename_unadjuster: 15.449µs, max_same_issues: 867ns, uniq_by_line: 320ns, fixer: 294ns, skip_files: 227ns, exclude: 225ns, diff: 216ns, sort_results: 210ns, source_code: 188ns, max_from_linter: 165ns, severity-rules: 163ns, max_per_file_from_linter: 114ns, path_shortener: 105ns, path_prefixer: 91ns INFO [runner] linters took 273.293577ms with stages: goanalysis_metalinter: 245.000884ms INFO File cache stats: 0 entries of total size 0B INFO Memory: 12 samples, avg is 46.5MB, max is 105.5MB INFO Execution took 1.026388844s ```
-j 6, no cache ```console $ golangci-lint cache clean; golangci-lint run -v -j 6 INFO golangci-lint has version 1.62.0 built with go1.23.2 from 22b58c9b on 2024-11-10T19:09:02Z INFO [config_reader] Config search paths: [./ /home/ldez/sources/golangci/golangci-lint /home/ldez/sources/golangci /home/ldez/sources /home/ldez /home /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 36 linters: [bodyclose copyloopvar depguard dogsled dupl errcheck errorlint funlen gocheckcompilerdirectives gochecknoinits goconst gocritic gocyclo godox gofmt goimports goprintffuncname gosec gosimple govet ineffassign intrange lll misspell mnd nakedret noctx nolintlint revive staticcheck stylecheck testifylint unconvert unparam unused whitespace] INFO [loader] Go packages loading at mode 8767 (files|imports|name|types_sizes|exports_file|deps|compiled_files) took 772.596978ms INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 10.451495ms INFO [linters_context/goanalysis] analyzers took 3m17.412213722s with top 10 stages: gocritic: 2m1.823760693s, buildir: 33.6956026s, goimports: 5.404502777s, dupl: 5.185422288s, unconvert: 4.23512608s, the_only_name: 4.063124552s, inspect: 1.244415709s, fact_deprecated: 1.150706743s, printf: 1.062151489s, ctrlflow: 987.108511ms INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/mmap by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/testenv by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir test/testdata_etc/abspath by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 1 issues from dir test/testdata_etc/unused_exported/lib by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 112 issues from dir internal/go/cache by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/quoted by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/robustio by pattern internal/go INFO [runner] Issues before processing: 510, after processing: 0 INFO [runner] Processors filtering stat (in/out): skip_dirs: 510/384, autogenerated_exclude: 384/384, exclude-rules: 384/68, cgo: 510/510, path_prettifier: 510/510, skip_files: 510/510, exclude: 384/384, nolint: 68/0, filename_unadjuster: 510/510, invalid_issue: 510/510, identifier_marker: 384/384 INFO [runner] processing took 22.894171ms with stages: exclude-rules: 10.161354ms, nolint: 4.712857ms, identifier_marker: 3.669547ms, path_prettifier: 2.049031ms, autogenerated_exclude: 1.429455ms, skip_dirs: 813.58µs, cgo: 23.641µs, invalid_issue: 21.659µs, filename_unadjuster: 9.612µs, max_same_issues: 924ns, skip_files: 370ns, fixer: 308ns, uniq_by_line: 286ns, exclude: 236ns, max_from_linter: 228ns, diff: 215ns, max_per_file_from_linter: 204ns, sort_results: 201ns, severity-rules: 159ns, path_shortener: 110ns, source_code: 107ns, path_prefixer: 87ns INFO [runner] linters took 28.108728303s with stages: goanalysis_metalinter: 28.085775658s INFO File cache stats: 425 entries of total size 915.0KiB INFO Memory: 278 samples, avg is 1747.0MB, max is 2968.0MB INFO Execution took 28.895793532s ```
-j 6, cache ```console $ golangci-lint cache clean; golangci-lint run -j 6; golangci-lint run -v -j 6 INFO golangci-lint has version 1.62.0 built with go1.23.2 from 22b58c9b on 2024-11-10T19:09:02Z INFO [config_reader] Config search paths: [./ /home/ldez/sources/golangci/golangci-lint /home/ldez/sources/golangci /home/ldez/sources /home/ldez /home /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 36 linters: [bodyclose copyloopvar depguard dogsled dupl errcheck errorlint funlen gocheckcompilerdirectives gochecknoinits goconst gocritic gocyclo godox gofmt goimports goprintffuncname gosec gosimple govet ineffassign intrange lll misspell mnd nakedret noctx nolintlint revive staticcheck stylecheck testifylint unconvert unparam unused whitespace] INFO [loader] Go packages loading at mode 8767 (compiled_files|exports_file|files|deps|imports|name|types_sizes) took 666.656723ms INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 29.799855ms INFO [linters_context/goanalysis] analyzers took 0s with no stages INFO [runner/skip_dirs] Skipped 112 issues from dir internal/go/cache by pattern internal/go INFO [runner/skip_dirs] Skipped 1 issues from dir test/testdata_etc/unused_exported/lib by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/testenv by pattern internal/go INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/robustio by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir test/testdata_etc/abspath by pattern test/testdata_etc INFO [runner/skip_dirs] Skipped 2 issues from dir internal/go/mmap by pattern internal/go INFO [runner/skip_dirs] Skipped 3 issues from dir internal/go/quoted by pattern internal/go INFO [runner] Issues before processing: 510, after processing: 0 INFO [runner] Processors filtering stat (in/out): exclude: 384/384, exclude-rules: 384/68, invalid_issue: 510/510, autogenerated_exclude: 384/384, skip_dirs: 510/384, path_prettifier: 510/510, skip_files: 510/510, identifier_marker: 384/384, nolint: 68/0, cgo: 510/510, filename_unadjuster: 510/510 INFO [runner] processing took 22.933408ms with stages: exclude-rules: 9.730914ms, nolint: 4.479087ms, identifier_marker: 3.732948ms, path_prettifier: 2.563195ms, autogenerated_exclude: 1.361272ms, skip_dirs: 835.636µs, invalid_issue: 88.818µs, cgo: 81.117µs, filename_unadjuster: 57.503µs, max_same_issues: 887ns, uniq_by_line: 290ns, fixer: 271ns, skip_files: 222ns, diff: 220ns, exclude: 212ns, sort_results: 184ns, severity-rules: 154ns, max_from_linter: 121ns, source_code: 99ns, max_per_file_from_linter: 95ns, path_prefixer: 82ns, path_shortener: 81ns INFO [runner] linters took 267.356317ms with stages: goanalysis_metalinter: 244.325956ms INFO File cache stats: 0 entries of total size 0B INFO Memory: 11 samples, avg is 46.0MB, max is 104.0MB INFO Execution took 967.3105ms ```