Skip to content

An itsy-bitsy bit vector with rank and select support

License

Notifications You must be signed in to change notification settings

dsalwasser/Bitsy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitsy

Bitsy is an itsy-bitsy bit vector with rank and select support, whose rank and select data structures have a combined space overhead of 3.40% in its default (fastest) configuration.

How to build

The requirements to build Bitsy are a C++20 compiler (GCC/Clang), CMake (v3.16+) and a build system (Ninja, GNU Make, etc.). To build Bitsy follow the steps below:

# Fetch a copy of Bitsy if not already present
git clone https://github.com/dsalwasser/Bitsy.git
cd Bitsy
# Actually build Bitsy
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel

PDEP Instructions

By default, the PDEP instruction is used. If Bitsy is running on a machine that has a slow PDEP instruction, then we recommend disabling this feature by adding the CMake flag -DBITSY_USE_PDEP=Off, as alternative implementations will be faster. Processors with a slow PDEP instruction are for example Zen 1 and Zen 2 generation AMD processors. On the other hand, all Intel processors and AMD processors after the Zen 2 generation have a fast PDEP instruction.

Huge Pages

Furthermore, huge pages are used by default to improve performance. Thus, an attempt is first made to allocate 2-MiB-sized huge pages and if this does not work (e.g., if it is not supported by the system), normal pages are allocated instead. However, if you do not want to use huge pages for some reason, this can be switched off with the additional CMake flags -DBITSY_HUGE_PAGES=Off.

Cross-Compilation

Also, the compiler flag -mtune=native is used by default. If Bitsy is not compiled on the machine on which it is executed, the flag can be disabled by adding the additional CMake flag -DBUILD_WITH_MTUNE_NATIVE=Off. However, we recommend compiling Bitsy on the machine on which it is executed using -mtune=native to improve performance.

How to use

We provide the ads_programm application to answer queries for a bit vector stored in a file and to write the corresponding answers to an output file. To use this application, first compile Bitsy by following the above steps and then run:

./build/apps/ads_programm <input_file> <output_file>

About

An itsy-bitsy bit vector with rank and select support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published