Results
Table of results (with no compiler optimizations: -O0). All times are in seconds.Table of results (with compiler optimization level -O2). All times are in seconds.
Data structure insert
(random)delete
(random)insert
(sorted)delete
(sorted)insert
(sorted rev.)delete
(sorted rev.)find
(random)AVL tree 1.420 2.015 0.917 1.002 0.902 0.994 0.712 Red-black tree 0.750 0.832 0.354 0.207 0.347 0.197 0.717 Skiplist 1.104 1.177 0.319 0.183 0.245 0.282 0.135 BList (2048) 4.335 3.299 9.377 (no opt)
3.398 (w/opt)1.172 2.914 3.490 2.452 Hash table (OA) 0.269 2.914 (PACK)
1.014 (MARK)0.251 Hash table (chaining) 0.391 0.392 0.367
Data structure insert*
(random)delete*
(random)insert
(sorted)delete
(sorted)insert
(sorted rev.)delete
(sorted rev.)find*
(random)AVL tree 0.689 0.842 0.186 0.197 0.185 0.196 0.345 Red-black tree 0.653 0.601 0.223 0.110 0.228 0.109 0.328 Skiplist 0.790 0.768 0.138 0.066 0.111 0.111 0.054 BList1 1.837 2.461 6.297 (no opt)2
0.691 (w/opt)30.175 0.475 3.371 2.402 Hash table (OA)4 0.213 0.655 (PACK)5
0.187 (MARK)60.222 Hash table (chaining)7 0.360 0.345 0.346
* These columns are the most relevant because they represent the average/typical case.
1The BList was tested with 2,048 items per node.
2No special optimizations were made and the normal search code was used to find the position.
3Before walking the list looking for the insertion point, a check was made to see if the value being inserted was larger than the largest element in the list. This meant no searching was required and it could simply be inserted at the end.
4The confguration: load factor is 0.667, hash function is Super Fast, and the collision resolution policy is linear probing.
5When an item is deleted, the remaining items in the cluster are reinserted into the table.
6When an item is deleted, the slot is simply marked as DELETED.
7The confguration: load factor is 5, hash function is Super Fast.
Here are some blist benchmarks that show the differences in performance.