Commit Graph

4 Commits

Author SHA1 Message Date
Derrick J. Wippler
ff66388131 Consistenthash improvements
* Now uses the much faster fnv1
* Now md5 hashs the keys to help distribute hosts more evenly in some
  cases.
2021-01-13 14:24:22 -06:00
Dvir Volk
21fc61ac51 changed default number of replicas in http pool hash ring to 50, and fixed hash ring benchmark 2014-07-08 12:15:05 +03:00
Damian Gryski
89ec0544ae consistenthash: replace linear search with binary search
The binary search quickly out-paces the linear search, even for a small
number of shards and replicas.

benchmark          old ns/op    new ns/op    delta
BenchmarkGet8            122          122   +0.00%
BenchmarkGet32           471          137  -70.91%
BenchmarkGet128         5619          254  -95.48%
BenchmarkGet512        90302          406  -99.55%
2014-06-17 17:09:50 +02:00
Dan Pupius
a06134f0da PeerPicker uses ring hash to pick peers 2013-10-01 19:10:50 -07:00