added some batch size 1000 microbenchmarks
This commit is contained in:
parent
7d6a6aeaa8
commit
38ee9be353
|
@ -114,7 +114,7 @@ func (s *Store) Delete(k []byte) (err error) {
|
||||||
func (s *Store) NewBatch() store.KVBatch {
|
func (s *Store) NewBatch() store.KVBatch {
|
||||||
return &Batch{
|
return &Batch{
|
||||||
s: s,
|
s: s,
|
||||||
ops: make([]op, 0, 100),
|
ops: make([]op, 0, 1000),
|
||||||
ms: map[string]store.AssociativeMergeChain{},
|
ms: map[string]store.AssociativeMergeChain{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ type Batch struct {
|
||||||
func newBatch(store *Store) *Batch {
|
func newBatch(store *Store) *Batch {
|
||||||
rv := Batch{
|
rv := Batch{
|
||||||
store: store,
|
store: store,
|
||||||
ops: make([]op, 0, 100),
|
ops: make([]op, 0, 1000),
|
||||||
merges: make(map[string]indexStore.AssociativeMergeChain),
|
merges: make(map[string]indexStore.AssociativeMergeChain),
|
||||||
}
|
}
|
||||||
return &rv
|
return &rv
|
||||||
|
@ -40,7 +40,7 @@ func newBatch(store *Store) *Batch {
|
||||||
func newBatchAlreadyLocked(store *Store) *Batch {
|
func newBatchAlreadyLocked(store *Store) *Batch {
|
||||||
rv := Batch{
|
rv := Batch{
|
||||||
store: store,
|
store: store,
|
||||||
ops: make([]op, 0, 100),
|
ops: make([]op, 0, 1000),
|
||||||
alreadyLocked: true,
|
alreadyLocked: true,
|
||||||
merges: make(map[string]indexStore.AssociativeMergeChain),
|
merges: make(map[string]indexStore.AssociativeMergeChain),
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,3 +106,33 @@ func BenchmarkCznicBIndexing4Workers100Batch(b *testing.B) {
|
||||||
|
|
||||||
CommonBenchmarkIndexBatch(b, s, 4, 100)
|
CommonBenchmarkIndexBatch(b, s, 4, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func BenchmarkCznicBIndexing1Workers1000Batch(b *testing.B) {
|
||||||
|
s, err := cznicb.StoreConstructor(nil)
|
||||||
|
if err != nil {
|
||||||
|
b.Fatal(err)
|
||||||
|
}
|
||||||
|
defer s.Close()
|
||||||
|
|
||||||
|
CommonBenchmarkIndexBatch(b, s, 1, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
func BenchmarkCznicBIndexing2Workers1000Batch(b *testing.B) {
|
||||||
|
s, err := cznicb.StoreConstructor(nil)
|
||||||
|
if err != nil {
|
||||||
|
b.Fatal(err)
|
||||||
|
}
|
||||||
|
defer s.Close()
|
||||||
|
|
||||||
|
CommonBenchmarkIndexBatch(b, s, 2, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
func BenchmarkCznicBIndexing4Workers1000Batch(b *testing.B) {
|
||||||
|
s, err := cznicb.StoreConstructor(nil)
|
||||||
|
if err != nil {
|
||||||
|
b.Fatal(err)
|
||||||
|
}
|
||||||
|
defer s.Close()
|
||||||
|
|
||||||
|
CommonBenchmarkIndexBatch(b, s, 4, 1000)
|
||||||
|
}
|
||||||
|
|
|
@ -122,3 +122,36 @@ func BenchmarkLevelDBIndexing4Workers100Batch(b *testing.B) {
|
||||||
|
|
||||||
CommonBenchmarkIndexBatch(b, s, 4, 100)
|
CommonBenchmarkIndexBatch(b, s, 4, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func BenchmarkLevelDBIndexing1Workers1000Batch(b *testing.B) {
|
||||||
|
s, err := leveldb.Open("test", leveldbTestOptions)
|
||||||
|
if err != nil {
|
||||||
|
b.Fatal(err)
|
||||||
|
}
|
||||||
|
defer os.RemoveAll("test")
|
||||||
|
defer s.Close()
|
||||||
|
|
||||||
|
CommonBenchmarkIndexBatch(b, s, 1, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
func BenchmarkLevelDBIndexing2Workers1000Batch(b *testing.B) {
|
||||||
|
s, err := leveldb.Open("test", leveldbTestOptions)
|
||||||
|
if err != nil {
|
||||||
|
b.Fatal(err)
|
||||||
|
}
|
||||||
|
defer os.RemoveAll("test")
|
||||||
|
defer s.Close()
|
||||||
|
|
||||||
|
CommonBenchmarkIndexBatch(b, s, 2, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
func BenchmarkLevelDBIndexing4Workers1000Batch(b *testing.B) {
|
||||||
|
s, err := leveldb.Open("test", leveldbTestOptions)
|
||||||
|
if err != nil {
|
||||||
|
b.Fatal(err)
|
||||||
|
}
|
||||||
|
defer os.RemoveAll("test")
|
||||||
|
defer s.Close()
|
||||||
|
|
||||||
|
CommonBenchmarkIndexBatch(b, s, 4, 1000)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user