Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conservative bloomfilter #42

Merged
merged 19 commits into from
Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

## Unreleased

- added bloom filter: https://github.com/cosmos/cosmos-db/pull/42/files
- Removed Badger & Boltdb
6 changes: 4 additions & 2 deletions goleveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/spf13/cast"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/errors"
"github.com/syndtr/goleveldb/leveldb/filter"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/syndtr/goleveldb/leveldb/util"
)
Expand All @@ -25,8 +26,9 @@ type GoLevelDB struct {
var _ DB = (*GoLevelDB)(nil)

func NewGoLevelDB(name string, dir string, opts Options) (*GoLevelDB, error) {
defaultOpts := &opt.Options{}

defaultOpts := &opt.Options{
Filter: filter.NewBloomFilter(10), // by default, goleveldb doesn't use a bloom filter.
Copy link
Member

@tac0turtle tac0turtle Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also disable seek compaction? im not sure how this effects things though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will look it up this week. Maybe we start here, and start to feed things into the iavl benchmarks-- they work now

}
if opts != nil {
files := cast.ToInt(opts.Get("maxopenfiles"))
if files > 0 {
Expand Down