flexihash icon indicating copy to clipboard operation
flexihash copied to clipboard

Use binary search for initial target lookup

Open shish opened this issue 8 years ago • 5 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

@sylr, could you make a PR with your changes https://github.com/sylr/flexihash/commit/d44ecc80196febb367919b573b2c6309b8ed7cfd to the main repository?

R-omk avatar Mar 15 '21 15:03 R-omk

looks nice. If you create a pull request, we're ready to accept it.

serima avatar Mar 16 '21 01:03 serima

I've made this pull request #24 @serima

ptcong avatar Oct 14 '21 08:10 ptcong

@serima could you make a release for the last merge ?

ptcong avatar May 17 '22 09:05 ptcong