mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-18 17:37:03 +00:00
use big initial big buffer
This commit is contained in:
parent
b5f34caa70
commit
ef776ac076
1 changed files with 3 additions and 5 deletions
|
|
@ -47,12 +47,10 @@ func FromStream(ctx context.Context, path string, r io.Reader) (<-chan Resource,
|
|||
errors := make(chan error)
|
||||
|
||||
go func() {
|
||||
const initialBufSize = 4 * 1024 * 1024 // Start with 4MB
|
||||
const maxBufSize = 256 * 1024 * 1024 // Start with 4MB
|
||||
|
||||
const maxBufSize = 256 * 1024 * 1024
|
||||
scanner := bufio.NewScanner(r)
|
||||
buf := make([]byte, initialBufSize)
|
||||
scanner.Buffer(buf, maxBufSize) // Resize up to 256MB
|
||||
buf := make([]byte, maxBufSize)
|
||||
scanner.Buffer(buf, maxBufSize)
|
||||
scanner.Split(SplitYAMLDocument)
|
||||
|
||||
SCAN:
|
||||
|
|
|
|||
Loading…
Reference in a new issue