WyHLL: The most accurate 3-bits HyperLogLog
1–10 of 14 posts
Re: WyHLL: The most accurate 3-bits HyperLogLog
#2HyperLogLog is an algorithm for the count-distinct problem, approximating the number of distinct elements in a multiset. Calculating the exact cardinality of a multiset requires an amount of memory proportional to the cardinality, which is impractical for very large data sets. Probabilistic cardinality estimators, such as the HyperLogLog algorithm, use significantly less memory than this, at the cost of obtaining only an approximation of the cardinality. The HyperLogLog algorithm is able to estimate cardinalities of > 109 with a typical accuracy (standard error) of 2%, using 1.5 kB of memory.
Re: WyHLL: The most accurate 3-bits HyperLogLog
#3Re: WyHLL: The most accurate 3-bits HyperLogLog
#4Is there a companion paper somewhere explaining how it works? I tried to read the comments in the source but didn't really understand much. (Might be related to the fact that I never knew much about vanilla HyperLogLog to begin with.)
Re: WyHLL: The most accurate 3-bits HyperLogLog
#5Is there a companion paper somewhere explaining how it works? I tried to read the comments in the source but didn't really understand much. (Might be related to the fact that I never knew much about vanilla HyperLogLog to begin with.)
This should get what you want https://googlethatforyou.com/?q=hyperloglog%20paper
Re: WyHLL: The most accurate 3-bits HyperLogLog
#6That, together with the lack of documentation, makes it much more difficult to figure out what's special about this implementation.
Re: WyHLL: The most accurate 3-bits HyperLogLog
#7Aside: I'm admittedly grumpy about the commit history, which is filled with entries such as "Add files via upload" and "Update README.md". That, together with the lack of documentation, makes it much more difficult to figure out what's special about this implementation.
The first divergence I see is in hllSparseToDense, although it seems more like a tweak to the input/output (passing in o->ptr instead of o, returning hdr instead of C_OK / C_ERR), than an algorithmic difference.
Line 550 contains a looser check:
if (span == 0) return -1;
omitting the check that p >= end.And... the only meaningful algorithmic change I found is in hllAdd, wherein we invalidate the cache if hllDenseAdd() returns 1.
There might be something else, but a lot of the details look to be standard (e.g. impl of murmurhash64a).
Re: WyHLL: The most accurate 3-bits HyperLogLog
#8Is there a companion paper somewhere explaining how it works? I tried to read the comments in the source but didn't really understand much. (Might be related to the fact that I never knew much about vanilla HyperLogLog to begin with.)
Re: WyHLL: The most accurate 3-bits HyperLogLog
#9For anyone wondering what HyperLogLog is: HyperLogLog is an algorithm for the count-distinct problem, approximating the number of distinct elements in a multiset. Calculating the exact cardinality of a multiset requires an amount of memory proportional to the cardinality, which is impractical for very large data sets. Probabilistic cardinality estimators, such as the HyperLogLog algorithm, use significantly less memo…
Supported computations include count distinct, frequency, sampling, and quantiles and histograms.
There’s a project called Apache Datasketches (developed at Yahoo) that implements production versions of these algorithms. They are useful in the implementations of search engines, discussion forum software, etc. that are designed for scale.
https://datasketches.apache.org/docs/Background/TheChallenge...
Another sketch is the well-known Bloom filter, which can quickly test if an element is part of a set without ever returning a false negative (useful for quickly checking a large database for whether a particular username is still available).
Re: WyHLL: The most accurate 3-bits HyperLogLog
#10For anyone wondering what HyperLogLog is: HyperLogLog is an algorithm for the count-distinct problem, approximating the number of distinct elements in a multiset. Calculating the exact cardinality of a multiset requires an amount of memory proportional to the cardinality, which is impractical for very large data sets. Probabilistic cardinality estimators, such as the HyperLogLog algorithm, use significantly less memo…
A multiset is a set where each element can be present multiple times. In other words, it's like an array or list but you don't care about the order.