pda / flexihash

Flexihash is a small PHP library which implements consistent hashing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use binary search for initial target lookup

shish opened this issue · comments

commented

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 :)

shish/flexihash-py@37f5679

commented

@sylr, could you make a PR with your changes sylr@d44ecc8 to the main repository?

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

I've made this pull request #24 @serima

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