lib/db, lib/model: Always use reasonable sized batches (fixes #2250, fixes #4112)

Harmonize how we use batches in the model, using ProtoSize() to judge
the actual weight of the entire batch instead of estimating. Use smaller
batches in the block map - I think we might have though that batch.Len()
in the leveldb was the batch size in bytes, but it's actually number of
operations.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4114
This commit is contained in:
Jakob Borg
2017-04-22 14:23:33 +00:00
committed by Audrius Butkevicius
parent 10894695c6
commit e9f05d138f
2 changed files with 26 additions and 22 deletions

View File

@@ -19,7 +19,7 @@ import (
var blockFinder *BlockFinder
const maxBatchSize = 256 << 10
const maxBatchSize = 1000
type BlockMap struct {
db *Instance