lib/mergeset: tune the number of rawItemsBlocks to merge at once

512 blocks give higher ingestion performance and slightly lower memory usage
This commit is contained in:
Aliaksandr Valialkin 2020-11-25 21:52:17 +02:00
parent 8fcd87a6a5
commit 8f8727cb65

View file

@ -369,7 +369,7 @@ func (tb *Table) AddItems(items [][]byte) error {
tb.rawItemsBlocks = append(tb.rawItemsBlocks, ib)
}
}
if len(tb.rawItemsBlocks) >= 1024 {
if len(tb.rawItemsBlocks) >= 512 {
blocksToMerge = tb.rawItemsBlocks
tb.rawItemsBlocks = nil
tb.rawItemsLastFlushTime = fasttime.UnixTimestamp()