On Mar 1, 5:32 pm, Mikael Johansson <[email protected]> wrote:
> The big difference is that pecl/memcache and Set-ConsistentHash after
> having built and sorted the continuum precomputes an array of 1024
> buckets, which can then be used by hashing the key and using a modulo
> operation on the array. It's computing this array that takes most of the
> time. What can be done is, as you say, caching it in shared memory
> alongside the persistent connection sockets. I'll have a look at this.

Caching it is the right way to go with this algorithm! You end up
doing just the modulo division as in the standard algorithm, so it
will be again O(1).

Nevertheless what the OP can do at the moment is play with the
constants :)

Reply via email to