Skip to content

shibox/HyperLogLog

Repository files navigation

HyperLogLog

the fastest hyperloglog implement for .net

Usage

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

Nuget Package

This code is available as the Nuget package HyperLogLog. To install, run the following command in the Package Manager Console:

Install-Package HyperLogLog

Performance of over 10,000,000 iterations -single typical usage

Method Duration Remarks
IHyperLogLog<int> 314ms
IHyperLogLog<uint> 314ms  
IHyperLogLog<long> 315ms  
IHyperLogLog<ulong> 316ms  

Performance of over 10,000,000 iterations -bulk typical usage

Method Duration Remarks
IHyperLogLog<int> 270ms
IHyperLogLog<uint> 271ms  
IHyperLogLog<long> 272ms  
IHyperLogLog<ulong> 272ms  

About

the fast hyperloglog implement for .net

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages