Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wdamron/go-anchorhash
A minimal-memory AnchorHash (consistent-hash) implementation for Go
https://github.com/wdamron/go-anchorhash
anchorhash consistent-hashing load-balancing
Last synced: about 2 months ago
JSON representation
A minimal-memory AnchorHash (consistent-hash) implementation for Go
- Host: GitHub
- URL: https://github.com/wdamron/go-anchorhash
- Owner: wdamron
- License: mit
- Created: 2019-03-20T01:14:49.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-27T07:00:14.000Z (almost 6 years ago)
- Last Synced: 2024-06-20T06:24:25.216Z (7 months ago)
- Topics: anchorhash, consistent-hashing, load-balancing
- Language: Go
- Size: 36.1 KB
- Stars: 77
- Watchers: 7
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# package anchor
package `anchor` provides a minimal-memory [AnchorHash](https://arxiv.org/abs/1812.09674) consistent-hash implementation for Go.
```go
import "github.com/wdamron/go-anchorhash"
```## More Info
* [AnchorHash: A Scalable Consistent Hash (Arxiv)](https://arxiv.org/abs/1812.09674)
* [Docs (godoc)](https://godoc.org/github.com/wdamron/go-anchorhash)## Benchmarks
* Go 1.12.1
* 2017 Macbook Pro; noisy, with a number of applications running
* 2.9 GHz Intel Core i7
* 16 GB 2133 MHz LPDDR3* **Capacity = 10**
* `NewCompactAnchor(10, 10)`: `BenchmarkGetBucket_10_10 200000000 5.81 ns/op`
* `NewCompactAnchor(10, 9)`: `BenchmarkGetBucket_9_10 200000000 6.71 ns/op`
* `NewCompactAnchor(10, 5)`: `BenchmarkGetBucket_5_10 100000000 10.8 ns/op`
* **Capacity = 1,000,000**
* `NewAnchor(1000000, 1000000)`: `BenchmarkGetBucket_1m_1m 200000000 7.47 ns/op`
* `NewAnchor(1000000, 900000)`: `BenchmarkGetBucket_900k_1m 200000000 9.26 ns/op`
* `NewAnchor(1000000, 500000)`: `BenchmarkGetBucket_500k_1m 100000000 17.6 ns/op`