Xor Filters: Faster and Smaller Than Bloom and Cuckoo Filters

Thomas Mueller Graf, Daniel Lemire
12/17/2019
77 citations
cs.DS

Official code: FastFilter/xorfilter (767 stars, Go, Apache-2.0, last commit 2026-01-26). 3 more implementations below.

Abstract

The Bloom filter provides fast approximate set membership while using little memory. Engineers often use these filters to avoid slow operations such as disk or network accesses.

Show full abstract

As an alternative, a cuckoo filter may need less space than a Bloom filter and it is faster. Chazelle et al. proposed a generalization of the Bloom filter called the Bloomier filter. Dietzfelbinger and Pagh described a variation on the Bloomier filter that can be used effectively for approximate membership queries. It has never been tested empirically, to our knowledge. We review an efficient implementation of their approach, which we call the xor filter. We find that xor filters can be faster than Bloom and cuckoo filters while using less memory. We further show that a more compact version of xor filters (xor+) can use even less space than highly compact alternatives (e.g., Golomb-compressed sequences) while providing speeds competitive with Bloom filters.

View on arXivView PDF

Code Implementations(4)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
FastFilter/xorfilterOfficial767GoApache-2.02026-01-26
FastFilter/xor_singleheaderOfficial435CApache-2.02026-10-09
FastFilter/fastfilter_cppOfficial286C++Apache-2.02026-09-21
FastFilter/fastfilter_javaOfficial261JavaApache-2.02026-07-30
Apache-2.0

Go library implementing binary fuse and xor filters

76756GoDec 16, 201910 months agoApache-2.0
Apache-2.0

Header-only binary fuse and xor filter library

43538C, CMakeApr 19, 20191 months agoApache-2.0
Apache-2.0

Fast Approximate Membership Filters (C++)

28633C++, CNov 7, 20182 months agoApache-2.0
Apache-2.0

Fast Approximate Membership Filters (Java)

26134JavaNov 7, 20184 months agoApache-2.0

Similar Papers

Cite this paper

@article{graf2019filters,
  title  = {Xor Filters: Faster and Smaller Than Bloom and Cuckoo Filters},
  author = {Thomas Mueller Graf and Daniel Lemire},
  year   = {2019},
  eprint = {1912.08258},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1912.08258}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1912.08258.svg)](https://codeofpaper.com/paper/1912.08258)

Discussion