flexihash icon indicating copy to clipboard operation
flexihash copied to clipboard

Use binary search for initial target lookup

Open shish opened this issue 6 years ago • 4 comments

I just got a 20x speedup in my python translation of this code by doing a binary search instead of "iterate over the whole sorted targets list one at a time until we find our first valid target", I suspect that the PHP version could see benefits too :)

https://github.com/shish/python-flexihash/commit/37f56794903c626726be421cbf2964178866ab91

shish avatar Dec 13 '17 22:12 shish