mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-21 10:57:01 +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)
|
errors := make(chan error)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
const initialBufSize = 4 * 1024 * 1024 // Start with 4MB
|
const maxBufSize = 256 * 1024 * 1024
|
||||||
const maxBufSize = 256 * 1024 * 1024 // Start with 4MB
|
|
||||||
|
|
||||||
scanner := bufio.NewScanner(r)
|
scanner := bufio.NewScanner(r)
|
||||||
buf := make([]byte, initialBufSize)
|
buf := make([]byte, maxBufSize)
|
||||||
scanner.Buffer(buf, maxBufSize) // Resize up to 256MB
|
scanner.Buffer(buf, maxBufSize)
|
||||||
scanner.Split(SplitYAMLDocument)
|
scanner.Split(SplitYAMLDocument)
|
||||||
|
|
||||||
SCAN:
|
SCAN:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue