From c5c59e61f4f82a33d018f560e35b70e2d967c4cd Mon Sep 17 00:00:00 2001 From: Steve Yen Date: Thu, 29 Jan 2015 10:20:26 -0800 Subject: [PATCH] make leveldb faster with non-zero sized batch --- index/store/leveldb/batch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index/store/leveldb/batch.go b/index/store/leveldb/batch.go index abce518f..ad815226 100644 --- a/index/store/leveldb/batch.go +++ b/index/store/leveldb/batch.go @@ -31,7 +31,7 @@ type Batch struct { func newBatch(store *Store) *Batch { rv := Batch{ store: store, - ops: make([]op, 0), + ops: make([]op, 0, 100), merges: make(map[string]indexStore.AssociativeMergeChain), } return &rv @@ -40,7 +40,7 @@ func newBatch(store *Store) *Batch { func newBatchAlreadyLocked(store *Store) *Batch { rv := Batch{ store: store, - ops: make([]op, 0), + ops: make([]op, 0, 100), alreadyLocked: true, merges: make(map[string]indexStore.AssociativeMergeChain), }