Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
library: btree_blue - a simple btree with rapid linear traversal
Subject: library: btree_blue - a simple btree with rapid linear traversal V7.2 This is a bug-fixed version. Thanks Uladzislau Rezki very much for testing. btree_blue is a simple btree whose algorithm implementation comes from Joern Engel's lib/btree. btree_blue extended lib/btree with several features and optimizations: Added Two-way links between leaf-nodes to offer a very fast linear traversal. Besides rapid linear traversal, insert, search, delete are also relatively fast comparing with btree, rbtee, even though with a big node size (4K) btree_blue is still some fast. The 0 value of key itself is allowed. Node size can be choosed in 256, 512, 1024, 2K, 4K. Or 192, 384 ... Key length has sizes of one long, two longs (32-bit OS). Joern Engel's lib/btree represents an elegance in logical and is fast and effective (100% slots usage). When I decided to add new features on it, which are required for me and in many practices, I found it is a challenge to keep speed and effective with lib/btree, so I have to do several optimizings to keep or (hopefully) get more performance. Basically, traversal in btree_blue is 8x (800%) faster than btree, 14x (1400%) faster than rbtree. Random insert/search/delete is 30% ~ 50% faster than btree and is 2x (200%) ~ 3x (300%) faster than rbtree, 2x (200%) ~ 4x (400%) faster than maple tree. Note, those comparisons may not much fair for the three trees: maple tree is RCU-safe and can deal with many complex cases, rbtree support duplicated keys, lib/btree's grace logical has virtue itself ... Signed-off-by: Liu Weifeng 4019c26b5c0d5f6b <liuwf@mailbox.org>
- Loading branch information