Bit-array-based alternatives to HyperLogLog

Svante Janson, Jérémie Lumbroso, Robert Sedgewick

Research output: Contribution to journalArticlepeer-review

Abstract

We present a family of algorithms for the problem of estimating the number of distinct items in an input stream that are simple to implement and are appropriate for practical applications. Our algorithms are a logical extension of the series of algorithms developed by Flajolet and his coauthors starting in 1983 that culminated in the widely used HyperLogLog algorithm. These algorithms divide the input stream into M substreams and lead to a time-accuracy tradeoff where a small number of bits per substream are saved to achieve a relative accuracy proportional to 1/M. Our algorithms use just one or two bits per substream. Their effectiveness is demonstrated by a proof of approximate normality, with explicit expressions for standard errors that inform parameter settings and allow proper quantitative comparisons with other methods. Performance hypotheses are validated through experiments using a realistic input stream, with the general conclusion that our algorithms are significantly more accurate than HyperLogLog when using the same amount of memory, and they use significantly less memory than HyperLogLog to achieve a given accuracy.

Original languageEnglish (US)
Article number115450
JournalTheoretical Computer Science
Volume1054
DOIs
StatePublished - Nov 3 2025

All Science Journal Classification (ASJC) codes

  • Theoretical Computer Science
  • General Computer Science

Keywords

  • Cardinality estimation
  • HyperLogLog
  • Sketching

Fingerprint

Dive into the research topics of 'Bit-array-based alternatives to HyperLogLog'. Together they form a unique fingerprint.

Cite this