Giter VIP home page Giter VIP logo

gcs's Introduction

Simple implementation of the Golomb Compressed Sets (GCS), a statistical
compressed data-structure. It is similar to Bloom filters, but it is far more
compact: given N elements, and P probability of a false positive, an optimal
Bloom filter requires at least N*log2(e)*log2(1/P) bits, where GCS gets the
bar closer to theoretical minimum of N*log2(1/P). With real-world data sets,
GCS can be 20-30% more compact than a Bloom filter.

The cons is of course speed: GCS is fully compressed so a query is an order of
magnituted slower than Bloom filters. On the other hand, it is not required to
decompress it fully in RAM, so it can be streamed. Thus, they make sense in an
environment where queries are performed at interactive rate and RAM is scarce
compared to the dataset.

A full explanation of GCS can be found in my blog post on the subject:
http://giovanni.bajo.it/2011/09/golomb-coded-sets/

The provided implementations are in Python, C++ and Javascript. They are fully
equivalent, but the C++ and JS implementations cache the GCS in memory, while
the Python implementation streams it from disk. Examples of data sets (English
and Italian dictionaries) are provided to play with them. See test.sh.

Test live Javascript implementation here:
http://cybercase.github.io/gcs/

See these references for more details:
http://www.imperialviolet.org/2011/04/29/filters.html
http://algo2.iti.uni-karlsruhe.de/singler/publications/cacheefficientbloomfilters-wea2007.pdf

gcs's People

Contributors

rasky avatar cybercase avatar

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.