| Algorithm | It | Et | Tt |
| AVL | 1.16 | 2.13 | 1.50 |
| Fibheap | 0.57 | 4.05 | 1.82 |
| Skiplist | 2.15 | 2.67 | 2.34 |
| List | 1.56 | 0.18 | 1.07 |
| Rbtree | 1.00 | 1.00 | 1.00 |
| Algorithm | It | Et | Tt |
| AVL | 0.92 | 2.70 | 1.28 |
| Fibheap | 0.52 | 7.19 | 1.87 |
| Skiplist | 1.82 | 3.29 | 2.11 |
| List | 0.26 | 0.31 | 0.27 |
| Rbtree | 1.00 | 1.00 | 1.00 |
To start from the bottom, it's no real surprise that a list insert is the fastest one for data that arrives pretty much completely sorted. The insertion will only be a check of the back of the list followed by an insert, a O(1) operation. Extraction is always O(1) from lists, so extraction will always be impossible to beat. AVL is pretty close to rbtrees in performance, but loses on all accounts. So we can rule that one out. Ditto skiplists, they always perform worse. The fibonacci heap does exceptionally well on insert always, but extraction is slooow. It's also pretty complex implementation wise, so we'd need a lot of justification to add something like that to the block layer.
It appears that the previous choice of rbtrees wasn't totally off. They perform acceptably for sequential IO and well for random IO. If we enlarge the request pool, rbtrees would do much better than list insert for random IO. Memory consumption is also about the same. The node size for rbtrees is sizeof(unsigned long) bigger than for the list, close enough that it doesn't matter in real life.
So I don't plan to change from rbtrees anytime soon. I may consider a hybrid structure of some sort that just avoids doing a lot of work for sequential IO, since we can detect that. Then we only do real sorting on more random input, and then the rbtree will always be a win. For non-rotating devices, a non-sorting list will be utilized. This should be a big win for high IOPS rate SSD like devices.
SOCIAL SHARE CARD GENERATOR