Skip to content

Commit

Permalink
Disable GC for benchmarks. Add prgreb benchmarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero authored and masih committed Sep 3, 2022
1 parent 6429d4f commit 078bc88
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 5 deletions.
3 changes: 1 addition & 2 deletions bench/sth_conc_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ func sthWithPutConcurrency(b *testing.B, c int) func() (indexer.Interface, error
return storethehash.New(context.Background(), b.TempDir(),
indexer.BinaryValueCodec{},
c,
sth.GCInterval(30*time.Minute),
sth.GCTimeLimit(5*time.Minute),
sth.GCInterval(0),
sth.SyncInterval(3*time.Second),
sth.IndexBitSize(24),
)
Expand Down
44 changes: 41 additions & 3 deletions bench/store_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/filecoin-project/go-indexer-core"
"github.com/filecoin-project/go-indexer-core/store/memory"
"github.com/filecoin-project/go-indexer-core/store/pebble"
"github.com/filecoin-project/go-indexer-core/store/pogreb"
"github.com/filecoin-project/go-indexer-core/store/storethehash"
sth "github.com/ipld/go-storethehash/store"
)
Expand Down Expand Up @@ -48,6 +49,38 @@ func BenchmarkStore_PebbleGet_W3(b *testing.B) {
benchmarkStoreGet(b, newPebbleSubject(b), workload3(b))
}

func BenchmarkStore_PogrebPut_W0(b *testing.B) {
benchmarkStorePut(b, newPogrebSubject(b), workload0(b))
}

func BenchmarkStore_PogrebGet_W0(b *testing.B) {
benchmarkStoreGet(b, newPogrebSubject(b), workload0(b))
}

func BenchmarkStore_PogrebPut_W1(b *testing.B) {
benchmarkStorePut(b, newPogrebSubject(b), workload1(b))
}

func BenchmarkStore_PogrebGet_W1(b *testing.B) {
benchmarkStoreGet(b, newPogrebSubject(b), workload1(b))
}

func BenchmarkStore_PogrebPut_W2(b *testing.B) {
benchmarkStorePut(b, newPogrebSubject(b), workload2(b))
}

func BenchmarkStore_PogrebGet_W2(b *testing.B) {
benchmarkStoreGet(b, newPogrebSubject(b), workload2(b))
}

func BenchmarkStore_PogrebPut_W3(b *testing.B) {
benchmarkStorePut(b, newPogrebSubject(b), workload3(b))
}

func BenchmarkStore_PogrebGet_W3(b *testing.B) {
benchmarkStoreGet(b, newPogrebSubject(b), workload3(b))
}

func BenchmarkStore_StorethehashPut_W0(b *testing.B) {
benchmarkStorePut(b, sthSubject(b), workload1(b))
}
Expand Down Expand Up @@ -152,14 +185,19 @@ func newPebbleSubject(b *testing.B) func() (indexer.Interface, error) {
}
}

func newPogrebSubject(b *testing.B) func() (indexer.Interface, error) {
return func() (indexer.Interface, error) {
return pogreb.New(b.TempDir(), indexer.BinaryValueCodec{})
}
}

func sthSubject(b *testing.B) func() (indexer.Interface, error) {
return func() (indexer.Interface, error) {
return storethehash.New(context.Background(), b.TempDir(),
indexer.BinaryValueCodec{},
64,
sth.GCInterval(30*time.Minute),
sth.GCTimeLimit(5*time.Minute),
sth.SyncInterval(3*time.Second),
sth.GCInterval(0),
sth.SyncInterval(time.Second),
sth.IndexBitSize(24),
)
}
Expand Down

0 comments on commit 078bc88

Please sign in to comment.