IntersectMBO / lsm-tree

A Haskell library for on-disk tables based on LSM-trees
Apache License 2.0
24 stars 7 forks source link

Eliminate some allocations from ordinary index search #264

Open jeltsch opened 2 months ago

jeltsch commented 2 months ago

The search function of the ordinary index can probably get by with less allocations. We shall conduct a micro-benchmark in the style of the compact-index micro-benchmark and use its results to reduce the allocation count by turning specific patterns into bang patterns. See https://github.com/IntersectMBO/lsm-tree/pull/244#discussion_r1632935316 and follow-ups.

We shall extend the above-mentioned optimization to the binarySearchL function for immutable vectors, which is used by search, in case we haven’t ended up implementing that function by reusing binarySearchL from vector-algorithms.