mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
reduce mem. usage of unused and update staticcheck (#1063)
The primary improvement is in early clearing of analyzed package's TypeInfo, facts, etc for whole program analyzers (`unused`). Clear it when it becomes unused and GC collects them early. Initially this clearing was performed for all analyzers except `unused`. Update staticcheck from v0.0.1-2019.2.3 to v0.0.1-2020.1.4 Also in this commit: * speed up loading packages from export data (2.5s -> 2.1s for std) by not using mutex for export data since it was allowed in x/tools#07722704da13 * make an order of execution of linters stable * update renameio and robustio * use robustio in caching Relates: #987, #994, #995, #1011
This commit is contained in:
parent
77e211ba75
commit
52c9b88c25
16 changed files with 182 additions and 147 deletions
4
internal/cache/cache.go
vendored
4
internal/cache/cache.go
vendored
|
@ -14,7 +14,6 @@ import (
|
|||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
@ -24,6 +23,7 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/golangci/golangci-lint/internal/renameio"
|
||||
"github.com/golangci/golangci-lint/internal/robustio"
|
||||
)
|
||||
|
||||
// An ActionID is a cache action key, the hash of a complete description of a
|
||||
|
@ -232,7 +232,7 @@ func (c *Cache) GetBytes(id ActionID) ([]byte, Entry, error) {
|
|||
return nil, entry, err
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadFile(outputFile)
|
||||
data, err := robustio.ReadFile(outputFile)
|
||||
if err != nil {
|
||||
return nil, entry, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue