From 3e58c89ec608287ec9e1f24120b0200fb284d9c5 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Fri, 12 Aug 2016 17:37:29 -0700 Subject: [PATCH] increased default btree degrees --- buntdb.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/buntdb.go b/buntdb.go index 4b13a5d..67fd50e 100644 --- a/buntdb.go +++ b/buntdb.go @@ -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)