5 个版本
使用旧的 Rust 2015
0.1.4 | 2017年2月6日 |
---|---|
0.1.3 | 2017年1月27日 |
0.1.2 | 2017年1月27日 |
0.1.1 | 2017年1月27日 |
0.1.0 | 2017年1月18日 |
在 #hash-ring 中排名第 11
14KB
223 行
consistent_hash
一致性哈希算法的 Rust 实现。
目前这个包仅提供基于虚拟节点的静态构建的哈希环。
非正式基准测试
$ cat /proc/cpuinfo | grep 'model name' | head -1
model name : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
$ uname -a
Linux ubuntu 4.8.0-34-generic #36-Ubuntu SMP Wed Dec 21 17:24:18 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cargo run --release --example bench -- /usr/share/dict/words --vnode_count 1000 --nodes Rust Alef C++ Camlp4 CommonLisp Erlang Haskell Hermes Limbo Napier Napier88 Newsqueak NIL Sather StandardML
WORD COUNT: 99156
REAL NODE COUNT: 15
VIRTUAL NODE COUNT: 15000 (1000 per node)
SELECTED COUNT PER NODE:
- Rust: 6265
- NIL: 6642
- Sather: 7165
- Erlang: 6545
- Camlp4: 6912
- Napier88: 6287
- CommonLisp: 6901
- C++: 6504
- StandardML: 6937
- Hermes: 6166
- Newsqueak: 6725
- Alef: 6586
- Haskell: 6240
- Limbo: 6754
- Napier: 6527
ELAPSED: 18 ms
WORDS PER SECOND: 5342456
依赖项
~155KB