Giter VIP home page Giter VIP logo

hllpp's Introduction

hllpp

Build Status GoDoc

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.

hllpp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hllpp's Issues

panic: Index out of range

I hit the following panic (just once):

panic: runtime error: index out of range

goroutine 29 [running]:
github.com/mattbostock/example/vendor/github.com/retailnext/hllpp.getRegister(0xc420a3a000, 0x263, 0x400, 0x364000000005, 0xc420679e10)
        /go/src/github.com/mattbostock/example/vendor/github.com/retailnext/hllpp/dense.go:46 +0xe5
github.com/mattbostock/example/vendor/github.com/retailnext/hllpp.(*HLLPP).updateRegisterIfBigger(0xc42011e690, 0x100003640)
        /go/src/github.com/mattbostock/example/vendor/github.com/retailnext/hllpp/hllpp.go:127 +0x157
github.com/mattbostock/example/vendor/github.com/retailnext/hllpp.(*HLLPP).Add(0xc42011e690, 0xc420d16060, 0x60, 0x60)
        /go/src/github.com/mattbostock/example/vendor/github.com/retailnext/hllpp/hllpp.go:113 +0x1d5
main.main.func1(0x981b24, 0x16)
        /go/src/github.com/mattbostock/example/internal/test/bench/bench.go:85 +0x26d
created by main.main
        /go/src/github.com/mattbostock/example/internal/test/bench/bench.go:62 +0xbf

Question: What's the reason for using murmur hash?

Hey,

I just wanted to ask the reason for using murmur hash here instead of some other cryptographically strong hash like SHA3 or BLAKE3 or something? Wouldn't using murmur hash affect accuracy of results? I understand that you are optimising for memory instead of CPU so I feel using a cryptographically secure hash will still stay aligned with your goals.

Please advise if my thoughts are correct here. Thanks

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

None detected


  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.