Increase read buffer size to 64KB

This commit is contained in:
Junegunn Choi 2016-08-16 01:52:24 +09:00
parent c4c92142a6
commit 3a9532c8fd
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,8 @@ const (
coordinatorDelayStep time.Duration = 10 * time.Millisecond
// Reader
defaultCommand = `find . -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | sed s/^..//`
defaultCommand = `find . -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | sed s/^..//`
readerBufferSize = 64 * 1024
// Terminal
initialDelay = 20 * time.Millisecond

View File

@ -34,7 +34,7 @@ func (r *Reader) feed(src io.Reader) {
if r.delimNil {
delim = '\000'
}
reader := bufio.NewReader(src)
reader := bufio.NewReaderSize(src, readerBufferSize)
for {
// ReadBytes returns err != nil if and only if the returned data does not
// end in delim.