Merge pull request #835 from steveyen/use-1MB-buffer-for-file-merger
scorch zap file merger uses 1MB buffered writer
This commit is contained in:
commit
6693a89441
|
@ -29,6 +29,8 @@ import (
|
||||||
"github.com/golang/snappy"
|
"github.com/golang/snappy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var DefaultFileMergerBufferSize = 1024 * 1024
|
||||||
|
|
||||||
const docDropped = math.MaxUint64 // sentinel docNum to represent a deleted doc
|
const docDropped = math.MaxUint64 // sentinel docNum to represent a deleted doc
|
||||||
|
|
||||||
// Merge takes a slice of zap segments and bit masks describing which
|
// Merge takes a slice of zap segments and bit masks describing which
|
||||||
|
@ -55,7 +57,7 @@ func Merge(segments []*Segment, drops []*roaring.Bitmap, path string,
|
||||||
}
|
}
|
||||||
|
|
||||||
// buffer the output
|
// buffer the output
|
||||||
br := bufio.NewWriter(f)
|
br := bufio.NewWriterSize(f, DefaultFileMergerBufferSize)
|
||||||
|
|
||||||
// wrap it for counting (tracking offsets)
|
// wrap it for counting (tracking offsets)
|
||||||
cr := NewCountHashWriter(br)
|
cr := NewCountHashWriter(br)
|
||||||
|
|
Loading…
Reference in New Issue