increased default btree degrees

This commit is contained in:
Josh Baker 2016-08-12 17:37:29 -07:00
parent f240a9c339
commit 3e58c89ec6
1 changed files with 6 additions and 3 deletions

View File

@ -122,12 +122,15 @@ type exctx struct {
db *DB
}
// Default number of btree degrees
const btreeDegrees = 64
// Open opens a database at the provided path.
// If the file does not exist then it will be created automatically.
func Open(path string) (*DB, error) {
db := &DB{}
db.keys = btree.New(16, nil)
db.exps = btree.New(16, &exctx{db})
db.keys = btree.New(btreeDegrees, nil)
db.exps = btree.New(btreeDegrees, &exctx{db})
db.idxs = make(map[string]*index)
db.config = Config{
SyncPolicy: EverySecond,
@ -248,7 +251,7 @@ func (db *DB) createIndex(
db: db,
}
if less != nil {
idx.btr = btree.New(16, idx)
idx.btr = btree.New(btreeDegrees, idx)
}
if rect != nil {
idx.rtr = rtree.New(idx)