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

开发者

编程技术、框架工具、最佳实践

7959
篇文章

共 7959 篇 · 第 395/398 页

Reddit r/programming

Highest random weight in Elixir

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] [留言]

/u/joladev 2026-05-25 00:25 👁 4 查看原文 →