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:
Isaev Denis 2019-10-01 14:52:00 +03:00 committed by GitHub
parent ea417ffa0b
commit df4f6766ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 265 additions and 348 deletions

View file

@ -3,15 +3,10 @@ package linter
import (
"golang.org/x/tools/go/packages"
"github.com/golangci/golangci-lint/pkg/lint/astcache"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load"
"github.com/golangci/golangci-lint/internal/pkgcache"
"github.com/golangci/golangci-lint/pkg/fsutils"
"github.com/golangci/golangci-lint/pkg/config"
"github.com/golangci/golangci-lint/pkg/fsutils"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load"
"github.com/golangci/golangci-lint/pkg/logutils"
)
@ -30,7 +25,6 @@ type Context struct {
PkgCache *pkgcache.Cache
LoadGuard *load.Guard
ASTCache *astcache.Cache
}
func (c *Context) Settings() *config.LintersSettings {