• Stars
    star
    1,540
  • Rank 30,382 (Top 0.6 %)
  • Language
    C++
  • License
    Other
  • Created almost 11 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A high-performance, concurrent hash table

libcuckoo

libcuckoo provides a high-performance, compact hash table that allows multiple concurrent reader and writer threads.

The Doxygen-generated documentation is available at the project page.

Authors: Manu Goyal, Bin Fan, Xiaozhou Li, David G. Andersen, and Michael Kaminsky

For details about this algorithm and citations, please refer to our papers in NSDI 2013 and EuroSys 2014. Some of the details of the hashing algorithm have been improved since that work (e.g., the previous algorithm in 1 serializes all writer threads, while our current implementation supports multiple concurrent writers), however, and this source code is now the definitive reference.

Requirements

This library has been tested on Mac OSX >= 10.8 and Ubuntu >= 12.04.

It compiles with clang++ >= 3.3 and g++ >= 4.8, however we strongly suggest using the latest versions of both compilers, as they have greatly improved support for atomic operations. Building the library requires CMake version >= 3.1.0. To install it on Ubuntu

$ sudo apt-get update && sudo apt-get install cmake

Building

libcuckoo is a header-only library, so in order to get going, just add the libcuckoo subdirectory to your include path. These directions cover installing the library to a particular location on your system, and also building any the examples and tests included in the repository.

We suggest you build out of source, in a separate build directory:

$ mkdir build
$ cd build

There are numerous flags you can pass to CMake to set which parts of the repository it builds.

-DCMAKE_INSTALL_PREFIX : set the location where the libcuckoo header files are installed

-DCMAKE_BUILD_TYPE : enable different types of build flags for different purposes

-DBUILD_EXAMPLES=1 : tell CMake to build the examples directory

-DBUILD_TESTS=1 : build all tests in the tests directory

-DBUILD_STRESS_TESTS=1 : build all tests in the tests/stress-tests directory

-DBUILD_UNIT_TESTS=1 : build all tests in the tests/unit-tests directory

-DBUILD_UNIVERSAL_BENCHMARK=1 : build the universal benchmark in the tests/universal-benchmark directory. This benchmark allows you to test a variety of operations in arbitrary percentages, with specific keys and values. Consult the README in the benchmark directory for more details.

So, if, for example, we want to build all examples and all tests into a local installation directory, we'd run the following command from the build directory.

$ cmake -DCMAKE_INSTALL_PREFIX=../install -DBUILD_EXAMPLES=1 -DBUILD_TESTS=1 ..
$ make all
$ make install

Usage

When compiling your own files with libcuckoo, always remember to enable C++11 features on your compiler. On g++, this would be -std=c++11, and on clang++, this would be -std=c++11 -stdlib=libc++.

Once you have installed the header files and the install location has been added to your search path, you can include <libcuckoo/cuckoohash_map.hh>, and any of the other headers you installed, into your source file.

There is also a C wrapper around the table that can be leveraged to use libcuckoo in a C program. The interface consists of a template header and implementation file that can be used to generate instances of the hashtable for different key-value types.

See the examples directory for a demonstration of all of these features.

Tests

The tests directory contains a number of tests and benchmarks of the hash table, which also can serve as useful examples of how to use the table's various features. Make sure to enable the tests you want to build with the corresponding CMake flags. The test suite can be run with the make test command. The test executables can be run individually as well.

Issue Report

To let us know your questions or issues, we recommend you report an issue on github. You can also email us at [email protected].

Licence

Copyright (C) 2013, Carnegie Mellon University and Intel Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


The third-party libraries have their own licenses, as detailed in their source files.

More Repositories

1

cuckoofilter

C++
937
star
2

epaxos

Go
610
star
3

SuRF

First Practical and General-purpose Range Filter
C++
533
star
4

rdma_bench

A framework to understand RDMA
C
367
star
5

mica

MICA: A Fast In-memory Key-Value Store (see isca2015 branch for the ISCA2015 version)
C
203
star
6

memc3

MemC3
C
150
star
7

HOPE

Order-preserving key encoder
C++
122
star
8

fasst

Source code for our OSDI 2016 paper
C++
106
star
9

HERD

Java
62
star
10

cicada-engine

The Cicada engine
C++
56
star
11

paper_skel

A LaTeX paper skeleton for CS systems conference formats
Python
55
star
12

ffbf

Feed-forward Bloom filters
C
52
star
13

rankselect

Space-Efficient, High-Performance Rank & Select Structures on Uncompressed Bit Sequences
C++
51
star
14

mica2

A fast in-memory key-value store
C++
49
star
15

libcuckoo-c

High-performance Concurrent Cuckoo Hashing Library
47
star
16

gopt

Fast packet processing using CPUs
C
38
star
17

go-cuckoo

A high-performance, memory-efficient concurrent hash table
Go
36
star
18

cuckooswitch

A software-based Ethernet switch design built around a memory-efficient, high-performance, and highly-concurrent hash table for compact and fast FIB lookup
C
34
star
19

fast-succinct-trie

C++
25
star
20

nvram

Tools for safe management of persistent main memory.
C
25
star
21

libinger

https://www.usenix.org/conference/atc20/presentation/boucher
Rust
24
star
22

qlease

Go
22
star
23

cicada

Dependably fast multi-core in-memory transactions
19
star
24

gobin-codegen

Automatic codegen for encoding/binary marshaling
Go
17
star
25

cicada-exp-sigmod2017

Cicada SIGMOD 2017 evaluation
Python
16
star
26

microservices_microbenchmarks

Code for the benchmarks presented in https://www.usenix.org/conference/atc18/presentation/boucher
Rust
12
star
27

ARF

C++
11
star
28

msls-eval

Accurate and Fast Evaluation of Multi-Stage Log-Structured Designs
C++
10
star
29

catbench

CATBench, the Intel Cache Allocation Technology benchmarking suite described in our tech report, "Simple Cache Partitioning for Networked Workloads"
C
10
star
30

cicada-exp-sigmod2017-DBx1000

A fork of DBx1000 for Cicada SIGMOD 2017 evaluation
C++
9
star
31

SuRF-demo

SuRF demo
C++
5
star
32

biblio

TeX
5
star
33

libas-safe

POSIX async-signal safety without thinking about it
C
3
star
34

mica2-catbench

MICA 2 and gRPC for CATBench
C++
1
star
35

cicada-exp-sigmod2017-silo

A fork of Silo for Cicada SIGMOD 2017 evaluation
C++
1
star
36

tokio

Forked from tokio-rs/tokio
Rust
1
star
37

cicada-exp-sigmod2017-silo-masstree-beta

A fork of masstree-beta (referenced by Silo) for Cicada SIGMOD 2017 evaluation
C++
1
star
38

cicada-exp-sigmod2017-ermia

A fork of ermia for Cicada SIGMOD 2017 evaluation
C++
1
star