Skip to content

Commit

Permalink
expand scanner buffer size to 2MB
Browse files Browse the repository at this point in the history
  • Loading branch information
KevRiver committed Nov 6, 2024
1 parent 34b64a6 commit bb595d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ import (
// the lines aren't JSON-structured, it will simply write them out with no
// prettification.
func Scan(ctx context.Context, src io.Reader, sink sink.Sink, opts *HandlerOptions) error {

const bufferMaxSize = 2 * 1024 * 1024 // 2MB

in := bufio.NewScanner(src)
in.Buffer(make([]byte, 1024*1024), 1024*1024)
in.Buffer(make([]byte, 0, bufferMaxSize), bufferMaxSize)
in.Split(bufio.ScanLines)

var line uint64
Expand Down

0 comments on commit bb595d2

Please sign in to comment.