Andrew Noyes f5f5fb620b Run gc at 200%
150% pessimized the "real data" benchmark
2024-08-12 10:48:24 -07:00
2024-03-06 21:22:30 -08:00
2024-08-09 19:48:22 -07:00
2024-08-05 12:20:38 -07:00
2024-04-04 16:29:26 -07:00
2024-07-19 11:24:01 -07:00
2024-08-08 12:09:26 -07:00
2024-08-12 10:48:24 -07:00
2024-07-23 16:50:02 -07:00
2024-08-06 16:07:16 -07:00
2024-07-12 13:22:02 -07:00

A data structure for optimistic concurrency control on ranges of bitwise-lexicographically-ordered keys.

Intended as an alternative to FoundationDB's skip list.

Hardware for all benchmarks is an AMD Ryzen 9 7900 with (2x32GB) 5600MT/s CL28-34-34-89 1.35V RAM

Microbenchmark

Skip list

ns/op op/s err% ins/op cyc/op IPC bra/op miss% total benchmark
172.03 5,812,791.77 0.4% 3,130.62 879.00 3.562 509.23 0.0% 0.01 point reads
167.44 5,972,130.71 0.2% 3,065.14 862.27 3.555 494.30 0.0% 0.01 prefix reads
238.77 4,188,130.84 0.9% 3,589.93 1,259.30 2.851 637.12 0.0% 0.01 range reads
424.01 2,358,426.70 0.2% 5,620.05 2,242.35 2.506 854.80 1.7% 0.01 point writes
418.45 2,389,780.56 0.4% 5,525.07 2,211.05 2.499 831.71 1.7% 0.01 prefix writes
254.87 3,923,568.88 2.6% 3,187.01 1,366.50 2.332 529.11 2.7% 0.02 range writes
675.96 1,479,374.50 3.3% 7,735.41 3,468.60 2.230 1,386.02 1.8% 0.01 monotonic increasing point writes
137,986.20 7,247.10 0.6% 789,752.33 699,462.00 1.129 144,824.14 0.0% 0.01 worst case for radix tree
21.63 46,231,564.03 1.0% 448.00 107.14 4.181 84.00 0.0% 0.01 create and destroy

Radix tree (this implementation)

ns/op op/s err% ins/op cyc/op IPC bra/op miss% total benchmark
12.42 80,500,398.66 0.8% 180.38 61.57 2.930 41.51 0.4% 0.01 point reads
15.17 65,917,580.99 0.2% 279.47 74.95 3.729 55.54 0.3% 0.01 prefix reads
38.16 26,202,393.91 0.1% 803.07 189.13 4.246 141.68 0.2% 0.01 range reads
20.20 49,504,615.44 0.4% 363.00 100.35 3.617 49.81 0.3% 0.01 point writes
41.99 23,816,559.99 0.3% 799.27 209.63 3.813 154.32 0.1% 0.01 prefix writes
46.28 21,607,605.88 1.5% 953.79 231.47 4.121 168.34 0.0% 0.01 range writes
80.99 12,347,449.98 0.9% 1,501.97 406.50 3.695 281.89 0.1% 0.01 monotonic increasing point writes
318,010.00 3,144.56 1.0% 3,994,511.50 1,657,831.50 2.409 805,969.50 0.0% 0.01 worst case for radix tree
75.85 13,183,612.56 0.5% 1,590.01 385.64 4.123 258.00 0.0% 0.01 create and destroy

"Real data" test

Point queries only, best of three runs. Gc ratio is the ratio of time spent doing garbage collection to time spent adding writes or doing garbage collection. Lower is better.

skip list

Check: 4.47891 seconds, 364.05 MB/s, Add: 4.55599 seconds, 123.058 MB/s, Gc ratio: 37.1145%

radix tree

Check: 0.963721 seconds, 1691.93 MB/s, Add: 1.3288 seconds, 421.924 MB/s, Gc ratio: 42.8819%

hash table

(The hash table implementation doesn't work on range queries, and its purpose is to provide an idea of how fast point queries can be)

Check: 0.804094 seconds, 2027.81 MB/s, Add: 0.652952 seconds, 858.645 MB/s, Gc ratio: 35.3885%
Description
A data structure for optimistic concurrency control on ranges of bitwise-lexicographically-ordered keys.
Readme 25 MiB
v0.0.13 Latest
2024-08-26 21:24:21 +00:00
Languages
C++ 82.9%
TeX 8.1%
CMake 4.8%
Python 2.7%
Shell 0.9%
Other 0.6%