Contributing to Cuckoo Filter

Contributions are welcome via GitHub pull requests. To ensure a smooth process, please follow these guidelines.

Development Setup

  1. Fork and Clone: Fork the repository on GitHub and clone your fork locally.

  2. Prerequisites: Ensure you have a C++11 compiler and the OpenSSL development libraries installed. See the Installation Guide for details.

  3. Building for Debug: The Makefile is configured for optimized builds (-O3) by default. For development, you should enable debug symbols. Edit the Makefile and switch the OPT flag:

    // Uncomment one of the following to switch between debug and opt mode
    // OPT = -O3 -DNDEBUG
    OPT = -g -ggdb
    
  4. Build: Re-run make to compile with debug flags.

    make clean
    make test

Running Tests

The primary test case is the example program in example/test.cc. You can build and run it as follows:

make test
./test

This program checks for basic functionality and measures the false positive rate. Ensure it completes successfully after making your changes.

For performance-related changes, you should also run the benchmarks in the benchmarks/ directory to assess the impact of your modifications.

Code Style

This project follows the Google C++ Style Guide. To help enforce this style, the repository includes a .clang-format configuration file.

Before submitting a pull request, please format your code using clang-format:

# Install clang-format (e.g., via 'sudo apt-get install clang-format' or 'brew install clang-format')

# Format a specific file
clang-format -i -style=file src/your_changed_file.h

Running this command will automatically apply the correct formatting rules to your code.

Submitting a Pull Request

  1. Create a new branch for your feature or bug fix.
  2. Commit your changes with clear, descriptive messages.
  3. Ensure your code is formatted with clang-format.
  4. Push your branch to your fork.
  5. Open a pull request from your fork to the efficient/cuckoofilter master branch.
  6. Provide a detailed description of your changes in the pull request.