I’m making a datastructure (I called it
SparseArraySparseModeData) to efficiently store a sparse vec. What it does is that it stores both the address, and the value of each element. To get the value at an index, it runs a hybrid binary-interpolation search on the vector of addresses. It’s slow, though - the “hot” function is called
find_address, which does the searching. The address vector is assumed to have 4 sections, each of which is piecewise linear. Any ideas on how to optimize it (just “for fun”)? The code is here.