Skip to content

Commit 85441b8

Browse files
committed
Improve README.md
1 parent 10615d5 commit 85441b8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,18 @@ skeleton = HRW.Skeleton.build(["server1", "server2", "server3"])
2121
HRW.Skeleton.owner("192.168.0.2", skeleton)
2222
#=> "server3"
2323
```
24+
25+
## Benchmarks
26+
27+
tl;dr HRW performs similarly to ExHashRing on smaller node lists, but falls behind as the node list grows. HRW.Skeleton offsets some of the issues, but doesn't match ExHashRing.
28+
29+
Lookup latency on Apple M4 Pro / Elixir 1.19.5 / OTP 28.5, median per call:
30+
31+
| nodes | HRW.owner | HRW.Skeleton.owner | ExHashRing.find_node |
32+
|-------:|------------:|-------------------:|---------------------:|
33+
| 10 | 292 ns | 292 ns | 333 ns |
34+
| 100 | 2.67 µs | 875 ns | 375 ns |
35+
| 1,000 | 25.54 µs | 1.08 µs | 380 ns |
36+
| 10,000 | 253.58 µs | 1.38 µs | 420 ns |
37+
38+
Reproduce with `elixir benches/hrw.exs`.

0 commit comments

Comments
 (0)