Contributing to Cuckoo Filter
Contributions are welcome via GitHub pull requests. To ensure a smooth process, please follow these guidelines.
Development Setup
-
Fork and Clone: Fork the repository on GitHub and clone your fork locally.
-
Prerequisites: Ensure you have a C++11 compiler and the OpenSSL development libraries installed. See the Installation Guide for details.
-
Building for Debug: The
Makefileis configured for optimized builds (-O3) by default. For development, you should enable debug symbols. Edit theMakefileand switch theOPTflag:// Uncomment one of the following to switch between debug and opt mode // OPT = -O3 -DNDEBUG OPT = -g -ggdb -
Build: Re-run
maketo 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
- Create a new branch for your feature or bug fix.
- Commit your changes with clear, descriptive messages.
- Ensure your code is formatted with
clang-format. - Push your branch to your fork.
- Open a pull request from your fork to the
efficient/cuckoofiltermasterbranch. - Provide a detailed description of your changes in the pull request.