the fastest hyperloglog implement for .net
Usage is very simple:
IHyperLogLog<string> estimator = new FastHyperLogLog();
estimator.Add("Alice");
estimator.Add("Bob");
estimator.Add("Alice");
estimator.Add("George Michael");
ulong count = estimator.Count(); // will be 3
IHyperLogLog<int> estimator = new FastHyperLogLog();
estimator.Add(1);
estimator.Add(2);
estimator.Add(3);
estimator.Add(2);
ulong count = estimator.Count(); // will be 3
uint[] array = new uint[] {1,2,3,2 };
IHyperLogLog<uint> estimator = new FastHyperLogLog();
estimator.BulkAdd(array);
ulong count = estimator.Count(); // will be 3
This code is available as the Nuget package HyperLogLog. To install, run the following command in the Package Manager Console:
Install-Package HyperLogLog
| Method | Duration | Remarks |
|---|---|---|
| IHyperLogLog<int> | 314ms | |
| IHyperLogLog<uint> | 314ms | |
| IHyperLogLog<long> | 315ms | |
| IHyperLogLog<ulong> | 316ms |
| Method | Duration | Remarks |
|---|---|---|
| IHyperLogLog<int> | 270ms | |
| IHyperLogLog<uint> | 271ms | |
| IHyperLogLog<long> | 272ms | |
| IHyperLogLog<ulong> | 272ms |