A data structure for optimistic concurrency control on ranges of bitwise-lexicographically-ordered keys. Intended to replace FoundationDB's skip list. # FoundationDB's benchmark ## Skip list ``` New conflict set: 4.189 sec 0.298 Mtransactions/sec 1.194 Mkeys/sec Detect only: 3.990 sec 0.313 Mtransactions/sec 1.253 Mkeys/sec Skiplist only: 2.849 sec 0.439 Mtransactions/sec 1.755 Mkeys/sec Performance counters: Build: 0.0913 Add: 0.0998 Detect: 3.99 D.Sort: 0.808 D.Combine: 0.0309 D.CheckRead: 1.67 D.CheckIntraBatch: 0.0305 D.MergeWrite: 1.18 D.RemoveBefore: 0.265 ``` ## Radix tree (this implementation) ``` New conflict set: 2.965 sec 0.422 Mtransactions/sec 1.686 Mkeys/sec Detect only: 2.761 sec 0.453 Mtransactions/sec 1.811 Mkeys/sec Skiplist only: 1.580 sec 0.791 Mtransactions/sec 3.165 Mkeys/sec Performance counters: Build: 0.0902 Add: 0.107 Detect: 2.76 D.Sort: 0.809 D.Combine: 0.0309 D.CheckRead: 0.658 D.CheckIntraBatch: 0.0294 D.MergeWrite: 0.921 D.RemoveBefore: 0.305 ``` # Our benchmark | ns/op | op/s | err% | total | benchmark |--------------------:|--------------------:|--------:|----------:|:---------- | 325.60 | 3,071,225.77 | 4.8% | 0.77 | `skip list (point reads)` | 297.15 | 3,365,278.10 | 1.7% | 0.72 | `skip list (prefix reads)` | 408.79 | 2,446,222.23 | 1.0% | 1.03 | `skip list (range reads)` | 261.88 | 3,818,471.08 | 1.3% | 0.73 | `skip list (point writes)` | 253.54 | 3,944,191.08 | 0.1% | 0.61 | `skip list (prefix writes)` | 258.73 | 3,865,078.52 | 0.8% | 0.62 | `skip list (range writes)` | 489.56 | 2,042,648.19 | 1.8% | 0.01 | `skip list (monotonic increasing point writes)` | 14.83 | 67,446,579.75 | 0.1% | 0.04 | `radix tree (point reads)` | 59.68 | 16,756,917.37 | 0.1% | 0.14 | `radix tree (prefix reads)` | 287.32 | 3,480,485.22 | 1.2% | 0.69 | `radix tree (range reads)` | 46.59 | 21,461,855.59 | 0.2% | 0.12 | `radix tree (point writes)` | 83.70 | 11,946,755.99 | 0.1% | 0.20 | `radix tree (prefix writes)` | 100.75 | 9,925,723.26 | 0.6% | 0.25 | `radix tree (range writes)` | 118.37 | 8,448,345.29 | 0.6% | 0.01 | `radix tree (monotonic increasing point writes)`