From 29dac15c9668ecd115ad1a82b0287dfded25cb65 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Fri, 1 Feb 2019 14:30:34 +0300 Subject: [PATCH] Move repo to NSPCC (#1) --- LICENSE | 2 +- README.md | 26 ++++++++++++++++++++------ go.mod | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/LICENSE b/LICENSE index 98e2519..34e79d6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Evgeniy Kulikov +Copyright (c) 2019 NSPCC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 9329da3..abb4b92 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,29 @@ # Golang HRW implementation -[![Build Status](https://travis-ci.org/im-kulikov/hrw.svg?branch=master)](https://travis-ci.org/im-kulikov/hrw) -[![codecov](https://codecov.io/gh/im-kulikov/hrw/badge.svg)](https://codecov.io/gh/im-kulikov/hrw) -[![Report](https://goreportcard.com/badge/github.com/im-kulikov/hrw)](https://goreportcard.com/report/github.com/im-kulikov/hrw) -[![GitHub release](https://img.shields.io/github/release/im-kulikov/hrw.svg)](https://github.com/im-kulikov/hrw) +[![Build Status](https://travis-ci.org/nspcc-dev/hrw.svg?branch=master)](https://travis-ci.org/nspcc-dev/hrw) +[![codecov](https://codecov.io/gh/nspcc-dev/hrw/badge.svg)](https://codecov.io/gh/nspcc-dev/hrw) +[![Report](https://goreportcard.com/badge/github.com/nspcc-dev/hrw)](https://goreportcard.com/report/github.com/nspcc-dev/hrw) +[![GitHub release](https://img.shields.io/github/release/nspcc-dev/hrw.svg)](https://github.com/nspcc-dev/hrw) [Rendezvous or highest random weight](https://en.wikipedia.org/wiki/Rendezvous_hashing) (HRW) hashing is an algorithm that allows clients to achieve distributed agreement on a set of k options out of a possible set of n options. A typical application is when clients need to agree on which sites (or proxies) objects are assigned to. When k is 1, it subsumes the goals of consistent hashing, using an entirely different method. ## Install -`go get github.com/im-kulikov/hrw` +`go get github.com/nspcc-dev/hrw` + +## Benchmark: + +``` +BenchmarkSortByWeight_fnv_10-8 3000000 435 ns/op 224 B/op 3 allocs/op +BenchmarkSortByWeight_fnv_100-8 200000 7238 ns/op 1856 B/op 3 allocs/op +BenchmarkSortByWeight_fnv_1000-8 10000 163158 ns/op 16448 B/op 3 allocs/op +BenchmarkSortByIndex_fnv_10-8 2000000 642 ns/op 384 B/op 7 allocs/op +BenchmarkSortByIndex_fnv_100-8 200000 8045 ns/op 2928 B/op 7 allocs/op +BenchmarkSortByIndex_fnv_1000-8 10000 227527 ns/op 25728 B/op 7 allocs/op +BenchmarkSortByValue_fnv_10-8 1000000 1244 ns/op 544 B/op 17 allocs/op +BenchmarkSortByValue_fnv_100-8 100000 12397 ns/op 4528 B/op 107 allocs/op +BenchmarkSortByValue_fnv_1000-8 10000 154278 ns/op 41728 B/op 1007 allocs/op +``` ## Example @@ -19,7 +33,7 @@ package main import ( "fmt" - "github.com/im-kulikov/hrw" + "github.com/nspcc-dev/hrw" ) func main() { diff --git a/go.mod b/go.mod index 81c57be..2585c68 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/im-kulikov/hrw +module github.com/nspcc-dev/hrw require github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72