Skip to content

v1.47.1 much slower #2997

Closed
Closed
@fredbi

Description

@fredbi

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

Today, our CI pipelines moved to v1.47.1 and we immediately felt the pain:
linting was suddenly taking about 3x longer, exhausting the resources of the CI VM (2 vCPU, 4GB RAM), even with a very small amount of changes and the "--new-from-rev master" flag. This behavior was consistent and observed on a dozen PRs today, even those with no change in the go code base.
run is slower when compared to v1.46.2, which was our previous version.

Running v1.47.1 from docker image: golangci/golangci-lint:latest-alpine
Extra installations required for alpine:
apk add git openssh-client bash ncurses gcc musl-dev

CLI for linting:
golangci-lint run --timeout 10m --new-from-rev master --build-tags integration

Version of golangci-lint

golangci-lint version running on the CI container.

$ golangci-lint --version
golangci-lint has version v1.47.1 built from ebd6dcbf on 2022-07-19T11:57:02Z

Configuration file

$ cat .golangci.yml
linters-settings:
  govet:
    check-shadowing: true
  gocyclo:
    min-complexity: 25
  maligned:
    suggest-new: true
  dupl:
    threshold: 150
  goconst:
    min-len: 3
    min-occurrences: 2
  forbidigo:
    forbid:
      - ^print.*$
      - 'fmt\.Print.*'
  funlen:
    lines: 100
    statements: 50
  gocognit:
    min-complexity: 80 # This is super high value. We should gradually lower it to 30-40.
run:
  skip-dirs:
    - integrationtest

linters:
  enable:
    - gofmt
    - goimports
    - bodyclose
    - dupl
    - forbidigo
    - gocognit
    - gocritic
    - goimports
    - gosec
    - nakedret
    - nolintlint
    - revive
    - stylecheck
    - unconvert
    - unparam
  disable:
    - maligned
    - lll
    - gochecknoinits
    - gochecknoglobals

Go environment

go version running on the CI container.

$ go version && go env
go version go1.18.4 linux/amd64
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/go/pkg/mod"
GONOPROXY="github.com/oneconcern/*"
GONOSUMDB="github.com/oneconcern/*"
GOOS="linux"
GOPATH="/go"
GOPRIVATE="github.com/oneconcern/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/root/project/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3438759853=/tmp/go-build -gno-record-gcc-switches"

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here

Code example or link to a public repository

N/A (private repo)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdependenciesRelates to an upstream dependencytopic: speed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions