今日已更新 284 条资讯 | 累计 25364 条内容
关于我们

Highest random weight in Elixir

/u/joladev 2026年05月25日 00:25 3 次阅读 来源:Reddit r/programming

I've had 3 weeks off work and I've used the time to rekindle my passion for coding (the old way, by hand). Stumbled upon this alternative to consistent hashing called rendezvous hashing (or highest random weight) and did a little deep dive. It ended up turning into a basic library, including the basic algorithm, a couple of variations, and the skeleton pattern for O(log n) access. It performs similar to ExHashRing for node counts <20, and with the skeleton optimization is competitive even in the tens of thousands of nodes, but it uses no NIFs or stateful processes, and the basic algorithm is essentially a one-liner. Anyway, it was fun to learn about, hope you enjoy it too! https://jola.dev/posts/highest-random-weight-in-elixir submitted by /u/joladev [link] [留言]

本文内容来源于互联网,版权归原作者所有
查看原文