File: README.md

package info (click to toggle)
golang-github-retailnext-hllpp 1.0.0+git20170901.6e8b6d3-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 196 kB
  • sloc: makefile: 2
file content (27 lines) | stat: -rw-r--r-- 1,184 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# hllpp

[![Build Status](https://travis-ci.org/retailnext/hllpp.svg)](https://travis-ci.org/retailnext/hllpp) [![GoDoc](https://godoc.org/github.com/retailnext/hllpp?status.svg)](https://godoc.org/github.com/retailnext/hllpp)

hllpp is an implementation of the HyperLogLog++ cardinality estimation algorithm in go. It optimizes for memory usage over CPU usage. It implements all the HyperLogLog optimizations introduced in the HyperLogLog++ paper (http://goo.gl/Z5Sqgu). Some notable features include:

* marshaling so you can serialize to your datastore
* extra space savings by only using 5 bits per register when possible
* built-in non-streaming murmur3 implementation for fast hashing of input data

## Usage

    h := hllpp.New()

    h.Add([]byte("barclay"))
    h.Add([]byte("reginald"))
    h.Add([]byte("barclay"))
    h.Add([]byte("broccoli"))

    fmt.Println(h.Count())
    // Output: 3

See the godocs for documentation and more examples.

### SEO

This package is a go or golang implementation of HyperLogLog or HyperLogLog++. It doesn't show up when you search for golang hyperloglog, so I am repeating the words golang hyperloglog in the README. golang hyperloglog.