Permalink
Browse files

The BPlusTree implementation works and can use generic key/value types.

The BTree implementation is limited to only uint64 type keys. The
performance difference is fairly striking given existing tests (which
are modification heavy).

The generic implementation has some important characteristics:

  1. It derives its specific types using client-supplied code (i.e. the
user of the library supplies specific key/value implementation). This is
important because there's no generic way to do value comparisons in Go.
  2. It uses factory methods to allocate and free node memory. This will
be critical for on-disk or other exotic implementations. 
  3. It uses a load/store mechanism on nodes. Nodes are not altered in
their backing storage. Instead slice-based representations are altered
then given back to client code. This simplifies the operations the
client must implement and made for much cleaner code.
  • Loading branch information...
Mike Matera
Mike Matera committed Dec 27, 2013
1 parent cd43db1 commit a136718124b0405378c6b1ab2e78f7fbbdc2c242
Showing with 277 additions and 342 deletions.
  1. +161 −180 btree/bplustree.go
  2. +14 −12 btree/btree.go
  3. +24 −25 btree/btree_test.go
  4. +14 −21 btree/node.go
  5. +64 −104 btree/simplenode.go
Oops, something went wrong.

0 comments on commit a136718

Please sign in to comment.