mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
reduce 1.5x memory usage on large repos on repeated runs (#764)
Get rid of AST cache: load AST when needed. Optimize memory allocations for go/analysis actions. Relates: #337
This commit is contained in:
parent
ea417ffa0b
commit
df4f6766ba
15 changed files with 265 additions and 348 deletions
|
@ -9,7 +9,6 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
|
||||
"github.com/golangci/golangci-lint/pkg/lint/astcache"
|
||||
"github.com/golangci/golangci-lint/pkg/lint/lintersdb"
|
||||
"github.com/golangci/golangci-lint/pkg/logutils"
|
||||
"github.com/golangci/golangci-lint/pkg/result"
|
||||
|
@ -32,13 +31,7 @@ func newNolint2FileIssue(line int) result.Issue {
|
|||
}
|
||||
|
||||
func newTestNolintProcessor(log logutils.Log) *Nolint {
|
||||
cache := astcache.LoadFromFilenames(log,
|
||||
filepath.Join("testdata", "nolint.go"),
|
||||
filepath.Join("testdata", "nolint2.go"),
|
||||
filepath.Join("testdata", "nolint_bad_names.go"),
|
||||
filepath.Join("testdata", "nolint_whole_file.go"),
|
||||
)
|
||||
return NewNolint(cache, log, lintersdb.NewManager(nil))
|
||||
return NewNolint(log, lintersdb.NewManager(nil))
|
||||
}
|
||||
|
||||
func getMockLog() *logutils.MockLog {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue