├── .clang-format ├── Bloom_Filter ├── Impala512.h ├── bloom.hpp ├── simd-block-fixed-fpp.h └── simd-block.h ├── CMakeLists.txt ├── LICENSE.md ├── Prefix-Filter ├── Shift_op.cpp ├── Shift_op.hpp ├── min_pd256.cpp └── min_pd256.hpp ├── README.md ├── RunAll.sh ├── TC-Shortcut ├── TC-shortcut.hpp ├── tc-sym.cpp └── tc-sym.hpp ├── Tests ├── PerfEvent.hpp ├── smart_tests.cpp ├── smart_tests.hpp └── wrappers.hpp ├── cmake-build-debug ├── .cmake │ └── api │ │ └── v1 │ │ ├── query │ │ ├── cache-v2 │ │ ├── cmakeFiles-v1 │ │ ├── codemodel-v2 │ │ └── toolchains-v1 │ │ └── reply │ │ ├── cache-v2-2dd2a3e80239b44d83cc.json │ │ ├── cmakeFiles-v1-eb5f60b98dcb2065ce32.json │ │ ├── codemodel-v2-5879e526388a2efa61dd.json │ │ ├── directory-.-Debug-f5ebdc15457944623624.json │ │ ├── index-2022-03-18T10-15-38-0219.json │ │ ├── target-example-Debug-f2fd9bd66abbfca03f37.json │ │ ├── target-example0-Debug-722e45bf24620d8a1287.json │ │ ├── target-measure_built-Debug-0ba116b65bf3d7ab6884.json │ │ ├── target-measure_built0-Debug-1c26e7153ab9b4dbb397.json │ │ ├── target-measure_built3-Debug-9e60f0edabd112451332.json │ │ ├── target-measure_fpp-Debug-6218804baa2d893c8235.json │ │ ├── target-measure_fpp0-Debug-ae3e716da61914872325.json │ │ ├── target-measure_fpp3-Debug-12090f7133d04d45c993.json │ │ ├── target-measure_perf-Debug-a7f31f032634834b67c5.json │ │ ├── target-measure_perf0-Debug-b41767523d8bde5ed7bd.json │ │ ├── target-measure_perf3-Debug-1815e855f242cbd76a5a.json │ │ └── toolchains-v1-b0b7064a037a803f7bb5.json ├── CMakeCache.txt ├── CMakeFiles │ ├── 3.21.1 │ │ ├── CMakeCCompiler.cmake │ │ ├── CMakeCXXCompiler.cmake │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ ├── CMakeSystem.cmake │ │ ├── CompilerIdC │ │ │ ├── CMakeCCompilerId.c │ │ │ └── a.out │ │ └── CompilerIdCXX │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ └── a.out │ ├── CMakeOutput.log │ ├── TargetDirectories.txt │ ├── clion-environment.txt │ ├── clion-log.txt │ ├── cmake.check_cache │ └── rules.ninja ├── Testing │ └── Temporary │ │ └── LastTest.log ├── build.ninja └── cmake_install.cmake ├── cuckoofilter ├── .clang-format ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── benchmarks │ ├── Makefile │ ├── bulk-insert-and-query.cc │ ├── conext-figure5.cc │ ├── conext-table3.cc │ ├── random.h │ └── timing.h ├── example │ └── test.cc └── src │ ├── bitsutil.h │ ├── cuckoofilter.h │ ├── cuckoofilter_stable.h │ ├── debug.h │ ├── hashutil.cc │ ├── hashutil.h │ ├── packedtable.h │ ├── permencoding.h │ ├── printutil.cc │ ├── printutil.h │ ├── simd-block-fixed-fpp.h │ ├── simd-block.h │ └── singletable.h ├── example.cpp ├── hashutil.h ├── main-built.cpp ├── main-fpp.cpp ├── main-perf.cpp └── scripts ├── Generate-median-csv.py ├── Naming.py ├── __pycache__ └── Naming.cpython-38.pyc ├── arg-plotter.py ├── build-csv-parser.py └── fpp-parser-server.py /.clang-format: -------------------------------------------------------------------------------- 1 | # Generated from CLion C/C++ Code Style settings 2 | BasedOnStyle: LLVM 3 | AccessModifierOffset: -4 4 | AlignAfterOpenBracket: Align 5 | AlignConsecutiveAssignments: false 6 | AlignOperands: true 7 | AllowAllArgumentsOnNextLine: false 8 | AllowAllConstructorInitializersOnNextLine: false 9 | AllowAllParametersOfDeclarationOnNextLine: false 10 | AllowShortBlocksOnASingleLine: Always 11 | AllowShortCaseLabelsOnASingleLine: false 12 | AllowShortFunctionsOnASingleLine: All 13 | AllowShortIfStatementsOnASingleLine: Always 14 | AllowShortLambdasOnASingleLine: All 15 | AllowShortLoopsOnASingleLine: true 16 | AlwaysBreakAfterReturnType: None 17 | AlwaysBreakTemplateDeclarations: Yes 18 | BreakBeforeBraces: Custom 19 | BraceWrapping: 20 | AfterCaseLabel: false 21 | AfterClass: false 22 | AfterControlStatement: Never 23 | AfterEnum: false 24 | AfterFunction: false 25 | AfterNamespace: false 26 | AfterUnion: false 27 | BeforeCatch: false 28 | BeforeElse: false 29 | IndentBraces: false 30 | SplitEmptyFunction: false 31 | SplitEmptyRecord: true 32 | BreakBeforeBinaryOperators: None 33 | BreakBeforeTernaryOperators: true 34 | BreakConstructorInitializers: BeforeColon 35 | BreakInheritanceList: BeforeColon 36 | ColumnLimit: 0 37 | CompactNamespaces: false 38 | ContinuationIndentWidth: 8 39 | IndentCaseLabels: true 40 | IndentPPDirectives: None 41 | IndentWidth: 4 42 | KeepEmptyLinesAtTheStartOfBlocks: true 43 | MaxEmptyLinesToKeep: 2 44 | NamespaceIndentation: All 45 | ObjCSpaceAfterProperty: false 46 | ObjCSpaceBeforeProtocolList: true 47 | PointerAlignment: Right 48 | ReflowComments: false 49 | SpaceAfterCStyleCast: true 50 | SpaceAfterLogicalNot: false 51 | SpaceAfterTemplateKeyword: false 52 | SpaceBeforeAssignmentOperators: true 53 | SpaceBeforeCpp11BracedList: false 54 | SpaceBeforeCtorInitializerColon: true 55 | SpaceBeforeInheritanceColon: true 56 | SpaceBeforeParens: ControlStatements 57 | SpaceBeforeRangeBasedForLoopColon: true 58 | SpaceInEmptyParentheses: false 59 | SpacesBeforeTrailingComments: 0 60 | SpacesInAngles: false 61 | SpacesInCStyleCastParentheses: false 62 | SpacesInContainerLiterals: false 63 | SpacesInParentheses: false 64 | SpacesInSquareBrackets: false 65 | TabWidth: 4 66 | UseTab: Never 67 | -------------------------------------------------------------------------------- /Bloom_Filter/Impala512.h: -------------------------------------------------------------------------------- 1 | // Copied from Apache Impala (incubating), usable under the terms in the Apache License, 2 | // Version 2.0. 3 | 4 | // This is a block Bloom filter (from Putze et al.'s "Cache-, Hash- and Space-Efficient 5 | // Bloom Filters") with some twists: 6 | // 7 | // 1. Each block is a split Bloom filter - see Section 2.1 of Broder and Mitzenmacher's 8 | // "Network Applications of Bloom Filters: A Survey". 9 | // 10 | // 2. The number of bits set per Add() is contant in order to take advantage of SIMD 11 | // instructions. 12 | 13 | #pragma once 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | #include "../hashutil.h" 22 | 23 | 24 | using uint32_t = ::std::uint32_t; 25 | using uint64_t = ::std::uint64_t; 26 | 27 | namespace Impala { 28 | __attribute__((always_inline)) inline uint32_t reduce(uint32_t hash, uint32_t n) { 29 | // http://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/ 30 | return (uint32_t) (((uint64_t) hash * n) >> 32); 31 | } 32 | 33 | __attribute__((always_inline)) inline uint64_t reduce64(uint64_t hash, uint64_t n) { 34 | // return hash % n; 35 | // http://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/ 36 | return (uint64_t) (((__uint128_t) hash * (__uint128_t) n) >> 64); 37 | // return (uint32_t) (((uint64_t) hash * n) >> 32); 38 | } 39 | 40 | static inline uint64_t rotl64(uint64_t n, unsigned int c) { 41 | // assumes width is a power of 2 42 | const unsigned int mask = (CHAR_BIT * sizeof(n) - 1); 43 | // assert ( (c<=mask) &&"rotate by type width or more"); 44 | c &= mask; 45 | return (n << c) | (n >> ((-c) & mask)); 46 | } 47 | 48 | static inline size_t get_number_of_buckets(size_t max_items) { 49 | constexpr size_t log2_one_over_eps = 8; 50 | constexpr double overhead = 1.5225; 51 | constexpr size_t bucket_size_in_bits = 512; 52 | size_t blooms_m = std::ceil(max_items * log2_one_over_eps * overhead); 53 | size_t number_of_buckets = (blooms_m + bucket_size_in_bits - 1) / bucket_size_in_bits; 54 | return number_of_buckets; 55 | } 56 | }// namespace Impala 57 | 58 | #include 59 | 60 | template 61 | class Impala512 { 62 | private: 63 | // The filter is divided up into Buckets: 64 | using Bucket = uint64_t[8]; 65 | 66 | const int bucketCount; 67 | 68 | Bucket *directory_; 69 | 70 | HashFamily hasher_; 71 | 72 | public: 73 | // Consumes at most (1 << log_heap_space) bytes on the heap: 74 | explicit Impala512(const int bits); 75 | 76 | ~Impala512() noexcept; 77 | 78 | void Add(const uint64_t key) noexcept; 79 | 80 | bool Find(const uint64_t key) const noexcept; 81 | 82 | uint64_t SizeInBytes() const { return sizeof(Bucket) * bucketCount; } 83 | 84 | size_t get_cap() const noexcept { 85 | return -1; 86 | } 87 | float density() const noexcept { 88 | size_t set_bits = 0; 89 | for (int i = 0; i < bucketCount; i++) { 90 | uint64_t temp; 91 | memcpy(&temp, directory_+ i, 8); 92 | set_bits += _mm_popcnt_u64(temp); 93 | } 94 | float res = 1.0 * set_bits / (bucketCount * 64); 95 | return res; 96 | } 97 | 98 | private: 99 | // A helper function for Insert()/Find(). Turns a 64-bit hash into a 512-bit Bucket 100 | // with 1 single 1-bit set in each 32-bit lane. 101 | static __m512i MakeMask(const uint64_t hash) noexcept; 102 | }; 103 | 104 | template 105 | Impala512::Impala512(const int n) 106 | : bucketCount(Impala::get_number_of_buckets(n)), 107 | directory_(nullptr), 108 | hasher_() { 109 | if (!__builtin_cpu_supports("avx2")) { 110 | throw ::std::runtime_error("Impala512 does not work without AVX2 instructions"); 111 | } 112 | const size_t alloc_size = bucketCount * sizeof(Bucket); 113 | const int malloc_failed = 114 | posix_memalign(reinterpret_cast(&directory_), 64, alloc_size); 115 | if (malloc_failed) throw ::std::bad_alloc(); 116 | // std::cout << "Ctor: SIMD-fixed byte size: " << SizeInBytes() << std::endl; 117 | memset(directory_, 0, alloc_size); 118 | } 119 | 120 | template 121 | Impala512::~Impala512() noexcept { 122 | // std::cout << "Dtor: SIMD-fixed byte size: " << SizeInBytes() << std::endl; 123 | // std::cout << "density: " << density() << std::endl; 124 | free(directory_); 125 | directory_ = nullptr; 126 | } 127 | 128 | // The SIMD reinterpret_casts technically violate C++'s strict aliasing rules. However, we 129 | // compile with -fno-strict-aliasing. 130 | template 131 | [[gnu::always_inline]] inline __m512i 132 | Impala512::MakeMask(const uint64_t hash) noexcept { 133 | const __m512i ones = _mm512_set1_epi64(1); 134 | // Odd contants for hashing: 135 | const __m512i rehash = _mm512_setr_epi64(0x89cdc1c02b2352b9ULL, 136 | 0x2b9aed3c5d9c5085ULL, 137 | 0xfb087273c257911bULL, 138 | 0x5ffd7847830af377ULL, 139 | 0x287348157aed6753ULL, 140 | 0x4e7292d5d251e97dULL, 141 | 0xe00e4fc1185d71cbULL, 142 | 0x4e3ebc18dc4c950bULL); 143 | // const __m512i rehash = _mm512_setr_epi64(0x47b6137bU, 0x44974d91U, 0x8824ad5bU, 0xa2b7289dU, 0x705495c7U, 0x2df1424bU, 0x9efc4947U, 0x5c6bfb31U); 144 | // Load hash into a YMM register, repeated eight times 145 | __m512i hash_data = _mm512_set1_epi64(hash); 146 | // Multiply-shift hashing ala Dietzfelbinger et al.: multiply 'hash' by eight different 147 | // odd constants, then keep the 5 most significant bits from each product. 148 | hash_data = _mm512_mullo_epi64(rehash, hash_data); 149 | hash_data = _mm512_srli_epi64(hash_data, 64 - 6); 150 | // Use these 5 bits to shift a single bit to a location in each 32-bit lane 151 | /* #ifndef DNDEBUG 152 | uint64_t a[8] = {0}; 153 | memcpy(a, (uint64_t *) (&hash_data), 64); 154 | if ((hash & ((1ULL<<20)-1)) == 0){ 155 | std::cout << "hash: " << hash << std::endl; 156 | for (size_t i = 0; i < 8; i++) { 157 | std::cout << "a[i]: " << a[i] << std::endl; 158 | } 159 | } 160 | auto temp = _mm512_sllv_epi64(ones, hash_data); 161 | 162 | // uint64_t a[8] = {0}; 163 | memcpy(a, (uint64_t *) (&temp), 64); 164 | int s = 0; 165 | for (size_t i = 0; i < 8; i++) { 166 | auto block_temp = _mm_popcnt_u64(a[i]); 167 | assert(block_temp == 1); 168 | s += _mm_popcnt_u64(a[i]); 169 | } 170 | if (s != 8) { 171 | std::cout << "s: " << s << std::endl; 172 | for (size_t i = 0; i < 8; i++) { 173 | std::cout << "a[i]: " << a[i] << std::endl; 174 | } 175 | } 176 | assert(s == 8); 177 | #endif 178 | */ 179 | return _mm512_sllv_epi64(ones, hash_data); 180 | } 181 | 182 | template 183 | [[gnu::always_inline]] inline void 184 | Impala512::Add(const uint64_t key) noexcept { 185 | const auto hash = hasher_(key); 186 | const uint32_t bucket_idx = Impala::reduce(Impala::rotl64(hash, 32), bucketCount); 187 | // const uint32_t bucket_idx = Impala::reduce64(hash, bucketCount); 188 | const __m512i mask = MakeMask(hash); 189 | __m512i *const bucket = &reinterpret_cast<__m512i *>(directory_)[bucket_idx]; 190 | _mm512_store_si512(bucket, _mm512_or_si512(*bucket, mask)); 191 | assert(Find(key)); 192 | } 193 | 194 | template 195 | [[gnu::always_inline]] inline bool 196 | Impala512::Find(const uint64_t key) const noexcept { 197 | const auto hash = hasher_(key); 198 | // const uint32_t bucket_idx = Impala::reduce64(hash, bucketCount); 199 | const uint32_t bucket_idx = Impala::reduce(Impala::rotl64(hash, 32), bucketCount); 200 | const __m512i mask = MakeMask(hash); 201 | const __m512i bucket = reinterpret_cast<__m512i *>(directory_)[bucket_idx]; 202 | // We should return true if 'bucket' has a one wherever 'mask' does. _mm512_testc_si512 203 | // takes the negation of its first argument and ands that with its second argument. In 204 | // our case, the result is zero everywhere iff there is a one in 'bucket' wherever 205 | // 'mask' is one. testc returns 1 if the result is 0 everywhere and returns 0 otherwise. 206 | constexpr __m512i zero_vec = {0, 0, 0, 0, 0, 0, 0, 0}; 207 | const __m512i res = _mm512_andnot_epi64(bucket, mask); 208 | return _mm512_cmpeq_epi64_mask(res, zero_vec) == 0xff; 209 | // const __m256i* array = reinterpret_cast<__m256i *>(&res); 210 | } 211 | -------------------------------------------------------------------------------- /Bloom_Filter/simd-block.h: -------------------------------------------------------------------------------- 1 | // Copied from Apache Impala (incubating), usable under the terms in the Apache License, 2 | // Version 2.0. 3 | 4 | // This is a block Bloom filter (from Putze et al.'s "Cache-, Hash- and Space-Efficient 5 | // Bloom Filters") with some twists: 6 | // 7 | // 1. Each block is a split Bloom filter - see Section 2.1 of Broder and Mitzenmacher's 8 | // "Network Applications of Bloom Filters: A Survey". 9 | // 10 | // 2. The number of bits set per Add() is contant in order to take advantage of SIMD 11 | // instructions. 12 | 13 | #pragma once 14 | 15 | 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | #include "../hashutil.h" 23 | #include 24 | 25 | 26 | using uint32_t = ::std::uint32_t; 27 | using uint64_t = ::std::uint64_t; 28 | 29 | template 30 | class SimdBlockFilter { 31 | private: 32 | // The filter is divided up into Buckets: 33 | using Bucket = uint32_t[8]; 34 | 35 | // log2(number of bytes in a bucket): 36 | static constexpr int LOG_BUCKET_BYTE_SIZE = 5; 37 | 38 | static_assert( 39 | (1 << LOG_BUCKET_BYTE_SIZE) == sizeof(Bucket) && sizeof(Bucket) == sizeof(__m256i), 40 | "Bucket sizing has gone awry."); 41 | 42 | // log_num_buckets_ is the log (base 2) of the number of buckets in the directory: 43 | const int log_num_buckets_; 44 | 45 | // directory_mask_ is (1 << log_num_buckets_) - 1. It is precomputed in the contructor 46 | // for efficiency reasons: 47 | const uint32_t directory_mask_; 48 | 49 | Bucket *directory_; 50 | 51 | HashFamily hasher_; 52 | 53 | public: 54 | // Consumes at most (1 << log_heap_space) bytes on the heap: 55 | explicit SimdBlockFilter(const int log_heap_space); 56 | 57 | SimdBlockFilter(SimdBlockFilter &&that) 58 | : log_num_buckets_(that.log_num_buckets_), 59 | directory_mask_(that.directory_mask_), 60 | directory_(that.directory_), 61 | hasher_(that.hasher_) {} 62 | 63 | ~SimdBlockFilter() noexcept; 64 | 65 | void Add(const uint64_t key) noexcept; 66 | 67 | bool Find(const uint64_t key) const noexcept; 68 | 69 | uint64_t SizeInBytes() const { return sizeof(Bucket) * (1ull << log_num_buckets_); } 70 | 71 | size_t get_cap() const noexcept { 72 | return -1; 73 | } 74 | private: 75 | // A helper function for Insert()/Find(). Turns a 32-bit hash into a 256-bit Bucket 76 | // with 1 single 1-bit set in each 32-bit lane. 77 | static __m256i MakeMask(const uint32_t hash) noexcept; 78 | 79 | SimdBlockFilter(const SimdBlockFilter &) = delete; 80 | 81 | void operator=(const SimdBlockFilter &) = delete; 82 | }; 83 | 84 | template 85 | SimdBlockFilter::SimdBlockFilter(const int log_heap_space) 86 | : // Since log_heap_space is in bytes, we need to convert it to the number of Buckets 87 | // we will use. 88 | log_num_buckets_(::std::max(1, log_heap_space - LOG_BUCKET_BYTE_SIZE)), 89 | // Don't use log_num_buckets_ if it will lead to undefined behavior by a shift that is 90 | // too large. 91 | directory_mask_((1ull << ::std::min(63, log_num_buckets_)) - 1), 92 | directory_(nullptr), 93 | hasher_() { 94 | if (!__builtin_cpu_supports("avx2")) { 95 | throw ::std::runtime_error("SimdBlockFilter does not work without AVX2 instructions"); 96 | } 97 | const size_t alloc_size = 1ull << (log_num_buckets_ + LOG_BUCKET_BYTE_SIZE); 98 | const int malloc_failed = 99 | posix_memalign(reinterpret_cast(&directory_), 64, alloc_size); 100 | if (malloc_failed) throw ::std::bad_alloc(); 101 | memset(directory_, 0, alloc_size); 102 | } 103 | 104 | template 105 | SimdBlockFilter::~SimdBlockFilter() noexcept { 106 | // std::cout << "SIMD byte size: " << SizeInBytes() << std::endl; 107 | free(directory_); 108 | directory_ = nullptr; 109 | } 110 | 111 | // The SIMD reinterpret_casts technically violate C++'s strict aliasing rules. However, we 112 | // compile with -fno-strict-aliasing. 113 | template 114 | [[gnu::always_inline]] inline __m256i 115 | SimdBlockFilter::MakeMask(const uint32_t hash) noexcept { 116 | const __m256i ones = _mm256_set1_epi32(1); 117 | // Odd contants for hashing: 118 | const __m256i rehash = _mm256_setr_epi32(0x47b6137bU, 0x44974d91U, 0x8824ad5bU, 119 | 0xa2b7289dU, 0x705495c7U, 0x2df1424bU, 0x9efc4947U, 0x5c6bfb31U); 120 | // Load hash into a YMM register, repeated eight times 121 | __m256i hash_data = _mm256_set1_epi32(hash); 122 | // Multiply-shift hashing ala Dietzfelbinger et al.: multiply 'hash' by eight different 123 | // odd constants, then keep the 5 most significant bits from each product. 124 | hash_data = _mm256_mullo_epi32(rehash, hash_data); 125 | hash_data = _mm256_srli_epi32(hash_data, 27); 126 | // Use these 5 bits to shift a single bit to a location in each 32-bit lane 127 | return _mm256_sllv_epi32(ones, hash_data); 128 | } 129 | 130 | template 131 | [[gnu::always_inline]] inline void 132 | SimdBlockFilter::Add(const uint64_t key) noexcept { 133 | const auto hash = hasher_(key); 134 | const uint32_t bucket_idx = hash & directory_mask_; 135 | const __m256i mask = MakeMask(hash >> log_num_buckets_); 136 | __m256i *const bucket = &reinterpret_cast<__m256i *>(directory_)[bucket_idx]; 137 | _mm256_store_si256(bucket, _mm256_or_si256(*bucket, mask)); 138 | } 139 | 140 | template 141 | [[gnu::always_inline]] inline bool 142 | SimdBlockFilter::Find(const uint64_t key) const noexcept { 143 | const auto hash = hasher_(key); 144 | const uint32_t bucket_idx = hash & directory_mask_; 145 | const __m256i mask = MakeMask(hash >> log_num_buckets_); 146 | const __m256i bucket = reinterpret_cast<__m256i *>(directory_)[bucket_idx]; 147 | // We should return true if 'bucket' has a one wherever 'mask' does. _mm256_testc_si256 148 | // takes the negation of its first argument and ands that with its second argument. In 149 | // our case, the result is zero everywhere iff there is a one in 'bucket' wherever 150 | // 'mask' is one. testc returns 1 if the result is 0 everywhere and returns 0 otherwise. 151 | return _mm256_testc_si256(bucket, mask); 152 | } 153 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | # set(CMAKE_C_COMPILER gcc-10) 4 | # set(CMAKE_CXX_COMPILER g++-10) 5 | # set(CMAKE_C_COMPILER clang) 6 | # set(CMAKE_CXX_COMPILER clang++) 7 | set(CMAKE_CXX_STANDARD 17) 8 | project(APD_ONLY) 9 | 10 | # set(COMPILE_FLAGS "-fprofile-instr-generate -fcoverage-mapping") 11 | # set(CMAKE_EXE_LINKER_FLAGS "-fprofile-instr-generate") 12 | 13 | set(CMAKE_CXX_FLAGS "-march=native") 14 | 15 | # Seems like those are necessary. 16 | # set(CMAKE_CXX_FLAGS "-mavx2 -mbmi -mbmi2 -mlzcnt -mpopcnt -mavx512vl -mavx512vbmi -mavx512dq -mavx512f -mavx512cd") 17 | 18 | #-fsanitize=undefined 19 | #-fsanitize=memory 20 | #set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined -fno-omit-frame-pointer") 21 | #set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=address -fno-omit-frame-pointer") 22 | 23 | set(PF_FILES 24 | Prefix-Filter/Shift_op.hpp Prefix-Filter/Shift_op.cpp 25 | Prefix-Filter/min_pd256.hpp Prefix-Filter/min_pd256.cpp 26 | ) 27 | 28 | set(CF_FILES 29 | cuckoofilter/src/bitsutil.h cuckoofilter/src/permencoding.h 30 | cuckoofilter/src/printutil.cc cuckoofilter/src/debug.h 31 | cuckoofilter/src/singletable.h cuckoofilter/src/packedtable.h 32 | cuckoofilter/src/cuckoofilter.h 33 | cuckoofilter/src/cuckoofilter_stable.h 34 | ) 35 | 36 | set(TESTS_FILES 37 | hashutil.h 38 | Tests/wrappers.hpp 39 | Tests/smart_tests.hpp 40 | Tests/smart_tests.cpp 41 | # Tests/PerfEvent.hpp 42 | ) 43 | 44 | set(TC_SHORTCUT_FILES 45 | # hashutil.h 46 | TC-Shortcut/tc-sym.hpp 47 | TC-Shortcut/tc-sym.cpp 48 | TC-Shortcut/TC-shortcut.hpp) 49 | 50 | 51 | set(Bloom_Files 52 | Bloom_Filter/simd-block.h 53 | Bloom_Filter/simd-block-fixed-fpp.h 54 | Bloom_Filter/Impala512.h 55 | Bloom_Filter/bloom.hpp 56 | # Bloom_Filter/bloom-simple.hpp 57 | ) 58 | 59 | set(ALL_FILES_NM 60 | ${Bloom_Files} 61 | ${TESTS_FILES} 62 | ${PF_FILES} 63 | 64 | ${CF_FILES} 65 | ${TC_SHORTCUT_FILES} 66 | 67 | ) 68 | set(ALL_FILES 69 | ${ALL_FILES_NM} 70 | # ${XOR_FILES} 71 | all_main.cpp 72 | ) 73 | 74 | 75 | ################################################################################ 76 | ################################################################################ 77 | ################################################################################ 78 | ################################################################################ 79 | # Measure built 80 | add_executable(measure_built0 ${ALL_FILES_NM} main-built.cpp) 81 | add_executable(measure_built3 ${ALL_FILES_NM} main-built.cpp) 82 | add_executable(measure_built ${ALL_FILES_NM} main-built.cpp) 83 | target_compile_options(measure_built0 PRIVATE -O0 -g3 -W) 84 | target_compile_options(measure_built3 PRIVATE -O3 -g3) 85 | target_compile_options(measure_built PRIVATE -Ofast -DNDEBUG) 86 | 87 | ################################################################################ 88 | 89 | # Measure fpp 90 | add_executable(measure_fpp0 ${ALL_FILES_NM} main-fpp.cpp) 91 | add_executable(measure_fpp3 ${ALL_FILES_NM} main-fpp.cpp) 92 | add_executable(measure_fpp ${ALL_FILES_NM} main-fpp.cpp) 93 | target_compile_options(measure_fpp0 PRIVATE -O0 -g3 -W) 94 | target_compile_options(measure_fpp3 PRIVATE -O3 -g3) 95 | target_compile_options(measure_fpp PRIVATE -Ofast -DNDEBUG ) 96 | 97 | ################################################################################ 98 | 99 | # Measure perf 100 | add_executable(measure_perf0 ${ALL_FILES_NM} main-perf.cpp) 101 | add_executable(measure_perf3 ${ALL_FILES_NM} main-perf.cpp) 102 | add_executable(measure_perf ${ALL_FILES_NM} main-perf.cpp) 103 | target_compile_options(measure_perf0 PRIVATE -O0 -g3 -W) 104 | target_compile_options(measure_perf3 PRIVATE -O3 -g3) 105 | target_compile_options(measure_perf PRIVATE -Ofast -DNDEBUG) 106 | 107 | ################################################################################ 108 | 109 | # Measure example 110 | add_executable(example0 ${ALL_FILES_NM} example.cpp) 111 | add_executable(example ${ALL_FILES_NM} example.cpp) 112 | target_compile_options(example0 PRIVATE -O0 -g3 -W) 113 | target_compile_options(example PRIVATE -Ofast -DNDEBUG) 114 | 115 | 116 | ################################################################################ 117 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021, All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /Prefix-Filter/min_pd256.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "min_pd256.hpp" 3 | 4 | namespace min_pd::check { 5 | bool validate_decoding(const __m256i *pd) { 6 | constexpr size_t t = MAX_CAP0 - 1; 7 | const u64 dirty_h = ((const u64 *) pd)[0]; 8 | size_t status = dirty_h & 31; 9 | size_t last_quot = select64(~(dirty_h >> 6), t) - t; 10 | if(status != last_quot) { 11 | std::cout << "status: \t" << status << std::endl; 12 | std::cout << "last_quot: \t" << last_quot << std::endl; 13 | assert(0); 14 | } 15 | return true; 16 | } 17 | 18 | bool val_header(const __m256i *pd) { 19 | const uint64_t h0 = reinterpret_cast(pd)[0]; 20 | const u64 h = (h0 >> 6) & H_mask; 21 | auto pop0 = _mm_popcnt_u64(h); 22 | assert(pop0 == QUOTS); 23 | return true; 24 | } 25 | 26 | bool val_last_quot_is_sorted(const __m256i *pd){ 27 | if (!did_pd_overflowed(pd)) 28 | return true; 29 | size_t last_quot = get_last_occupied_quot_only_full_pd(pd); 30 | size_t lq_cap = get_spec_quot_cap(last_quot, pd); 31 | assert(lq_cap); 32 | if (lq_cap == 1) 33 | return true; 34 | 35 | auto mp = (u8*)pd + 32 - lq_cap; 36 | for (size_t i = 1; i < lq_cap; ++i) { 37 | assert(mp[i-1] <= mp[i]); 38 | } 39 | return true; 40 | } 41 | }// namespace min_pd::check 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Prefix Filter 2 | 3 | Implementation of **Prefix-Filter**, which is an incremental filter (approximate set-membership queries). 4 | If you plan on using the Prefix-Filter, please cite our paper: 5 | **[Prefix Filter: Practically and Theoretically Better Than Bloom](https://arxiv.org/abs/2203.17139).** Tomer Even, Guy Even, Adam Morrison. 6 | To appear in PVLDB, 15(7). 7 | 8 | Short talk abouth the Prefix Filter: https://www.youtube.com/watch?v=KMVtvACSGo0 9 | 10 | ## Prerequisites 11 | 12 | - **Compiler:** A C++17 compiler such as GNU G++ or LLVM Clang++. 13 | - CMake (Version 3.10 or higher). 14 | - **System:** Linux. 15 | - **Hardware:** Intel. Support of AVX512 is a must. 16 | 17 | ###### Python Packages To Produce The Graphs 18 | 19 | - matplotlib 20 | - brokenaxes (From [here](https://github.com/bendichter/brokenaxes)). 21 | - pandas 22 | 23 | 24 | 27 | 28 | There are three main targets for three different benchmarks. 29 | 30 | 1) `measure_perf` for benchmarking performance of insertions and lookups under various loads. 31 | 2) `measure_build` for build-time. 32 | 3) `measure_fpp` for evaluating the false positive probability, and the "effective space consumption". 33 | 34 | There is also an example of how to use the Prefix-Filter in the file `example.cpp`: 35 | ```cpp 36 | #include "Tests/wrappers.hpp" 37 | 38 | int main(){ 39 | using spare = TC_shortcut; // Any incremental filter can replace TC_shortcut. 40 | using prefixFilter = Prefix_Filter; 41 | 42 | size_t filter_max_capacity = 1'000'000; // Choose any size. 43 | prefixFilter example_filter = FilterAPI::ConstructFromAddCount(filter_max_capacity); 44 | 45 | uint64_t x1 = 0x0123'4567'89ab'cdef; 46 | FilterAPI::Add(x1, &example_filter); // Insertions of an item x1. Insertion can be performed only one step at a time. 47 | 48 | bool res = FilterAPI::Contain(x1, &example_filter); // Lookup of x1. 49 | assert(res); //No false negative. 50 | 51 | uint64_t y1 = ~0x0123'4567'89ab'cdef; 52 | bool res2 = FilterAPI::Contain(y1, &example_filter); // Lookup of y1. 53 | std::cout << res2 << std::endl; // Possible false positive. (Although with one item in the filter, this is highly unlikely.) 54 | return 0; 55 | } 56 | ``` 57 | 58 | ### To build 59 | 60 | ``` 61 | git clone -b master https://github.com/TheHolyJoker/Prefix-Filter.git 62 | cd Prefix-Filter 63 | mkdir build 64 | cd build 65 | cmake .. -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 66 | t="measure_perf measure_built measure_fpp"; time cmake --build ./ --target $t -j 20 67 | ``` 68 | **On GCC release:** Older releases like 9.3 will work. We recommend using newer releases, which seems to perform better. 69 | ### To Run 70 | 71 | To run all benchmarks (from `Prefix-Filter/build` directory): 72 | ``` 73 | cp ../RunAll.sh RunAll.sh 74 | ./RunAll.sh 75 | ``` 76 | 77 | 78 | ###### Specific Target 79 | 80 | Any specific target (for example `measure_perf`) can be built and executed with as follows: 81 | ``` 82 | t="measure_perf"; time cmake --build ./ --target $t -j 20 && time taskset -c 2 ./$t 83 | ``` 84 | 85 | 87 | 88 | # Credits 89 | 90 | - **Xor Filter**: 91 | ["Xor Filters: Faster and Smaller Than Bloom and Cuckoo 92 | Filters."](https://arxiv.org/pdf/1912.08258.pdf) 93 | Graf, Thomas Mueller, and Daniel Lemire. \ 94 | [Repository](https://github.com/FastFilter/fastfilter_cpp).\ 95 | We build upon Xor filter's benchmarks. 96 | We also used Its BBF variant, its fast Bloom filter, and its [fast modulo alternative](https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/). 97 | 101 | - **Cuckoo Filter** \ 102 | ["Cuckoo Filter: Practically Better Than Bloom." ](https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf) Fan B, Andersen DG, Kaminsky M, Mitzenmacher MD. 103 | [Repository](https://github.com/efficient/cuckoofilter) 104 | - **Blocked Bloom Filter**\ 105 | We used two variants taken from the Xor filter's repository. 106 | 107 | 108 | - **Vector Quotient Filter**\ 109 | ["Vector Quotient Filters: Overcoming The Time/Space Trade-Off In Filter Design."](https://research.vmware.com/files/attachments/0/0/0/0/1/4/7/sigmod21.pdf). Pandey P, Conway A, Durie J, Bender MA, Farach-Colton M, Johnson R. Vector quotient filters: Overcoming the time/space trade-off in filter design.\ 110 | [Repository](https://github.com/splatlab/vqf).\ 111 | However, we used our own implementation, called *twoChoicer* (In file `TC-Shortcut/TC-shortcut.hpp`). 112 | -------------------------------------------------------------------------------- /RunAll.sh: -------------------------------------------------------------------------------- 1 | 2 | mkdir -p ../scripts/Inputs 3 | t="measure_perf"; 4 | s="measure_built"; 5 | time cmake --build ./ --target $t -j 50 6 | if ! [ $? -eq 0 ]; then 7 | exit 1; 8 | fi 9 | time cmake --build ./ --target $s -j 50 10 | if ! [ $? -eq 0 ]; then 11 | exit 2; 12 | fi 13 | 14 | if ! [ -z "$(ls -A ../scripts/Inputs)" ]; then 15 | echo "Inputs is not empty!" 16 | exit 3; 17 | fi 18 | 19 | time taskset -c 2 ./$t 20 | if ! [ $? -eq 0 ]; then 21 | echo "The benchmark was not completed!" 22 | exit; 23 | fi 24 | #sleep 120 25 | time taskset -c 2 ./$s 26 | if ! [ $? -eq 0 ]; then 27 | echo "The Built-bench was not completed!" 28 | exit; 29 | fi 30 | files_path="../scripts/Inputs/" 31 | ../scripts/arg-plotter.py $files_path 32 | ../scripts/build-csv-parser.py 33 | time cmake --build ./ --target measure_fpp -j 50 && time taskset -c 2 ./measure_fpp -------------------------------------------------------------------------------- /TC-Shortcut/tc-sym.cpp: -------------------------------------------------------------------------------- 1 | #include "tc-sym.hpp" 2 | 3 | 4 | namespace tc_sym::check { 5 | 6 | auto validate_number_of_quotient(const __m512i *pd) -> bool { 7 | auto pd64 = (const u64 *) pd; 8 | u64 h0 = pd64[0]; 9 | u64 h1 = pd64[1]; 10 | u64 h1_masked = pd64[1] & _bzhi_u64(-1, QUOTS + MAX_CAP - 64); 11 | auto pop0 = _mm_popcnt_u64(h0); 12 | auto pop1 = _mm_popcnt_u64(h1_masked); 13 | auto pop1_extended = _mm_popcnt_u64(h1); 14 | auto pop1_e2 = _mm_popcnt_u64(h1 & _bzhi_u64(-1, 40)); 15 | if (pop0 + pop1 == QUOTS) 16 | return true; 17 | 18 | 19 | std::cout << "h0: \t" << format_word_to_string(h0) << std::endl; 20 | std::cout << "h1: \t" << format_word_to_string(h1) << std::endl; 21 | std::cout << "h1_m: \t" << format_word_to_string(h1_masked) << std::endl; 22 | 23 | assert(0); 24 | return false; 25 | } 26 | 27 | 28 | auto validate_number_of_quotient(const __m512i *pd, const __m512i *backup_pd) -> bool { 29 | auto pd64 = (const u64 *) pd; 30 | u64 h0 = pd64[0]; 31 | u64 h1 = pd64[1]; 32 | u64 h1_masked = pd64[1] & _bzhi_u64(-1, QUOTS + MAX_CAP - 64); 33 | auto pop0 = _mm_popcnt_u64(h0); 34 | auto pop1 = _mm_popcnt_u64(h1_masked); 35 | auto pop1_extended = _mm_popcnt_u64(h1); 36 | auto pop1_e2 = _mm_popcnt_u64(h1 & _bzhi_u64(-1, 40)); 37 | if (pop0 + pop1 == QUOTS) 38 | return true; 39 | 40 | 41 | auto bpd64 = (const u64 *) backup_pd; 42 | std::cout << std::string(80, '=') << std::endl; 43 | std::cout << "h0: \t" << format_word_to_string(h0) << std::endl; 44 | std::cout << "h0: \t" << format_word_to_string(bpd64[0]) << std::endl; 45 | std::cout << std::endl; 46 | std::cout << "h1: \t" << format_word_to_string(h1) << std::endl; 47 | std::cout << "h1: \t" << format_word_to_string(bpd64[1]) << std::endl; 48 | std::cout << std::endl; 49 | std::cout << "h1_m: \t" << format_word_to_string(h1_masked) << std::endl; 50 | std::cout << "h1_m: \t" << format_word_to_string(bpd64[1] & _bzhi_u64(-1, 40)) << std::endl; 51 | std::cout << std::string(80, '=') << std::endl; 52 | // std::cout << std::string(80, '~') << std::endl; 53 | // std::cout << "h1: \t" << format_word_to_string(bpd64[1]) << std::endl; 54 | 55 | assert(0); 56 | return false; 57 | } 58 | 59 | 60 | }// namespace tc_sym::check 61 | 62 | // for printing 63 | namespace tc_sym::check { 64 | void p_format_word(uint64_t x) { 65 | std::string res = to_bin(x, 64); 66 | std::cout << space_string(res) << std::endl; 67 | } 68 | 69 | auto format_word_to_string(uint64_t x, size_t length) -> std::string { 70 | std::string res = to_bin(x, length);// + "\n"; 71 | return space_string(res); 72 | // std::cout << space_string(res) << std::endl; 73 | } 74 | 75 | /** 76 | * @brief This prints the binary representation of x. Usually, a reversed representation is needed. 77 | * 78 | * @param x 79 | * @param length 80 | * @return std::string 81 | */ 82 | auto to_bin(uint64_t x, size_t length) -> std::string { 83 | assert(length <= 64); 84 | uint64_t b = 1ULL; 85 | std::string res; 86 | for (size_t i = 0; i < length; i++) { 87 | res += (b & x) ? "1" : "0"; 88 | b <<= 1ul; 89 | } 90 | return res; 91 | } 92 | 93 | auto space_string(std::string s) -> std::string { 94 | std::string new_s = ""; 95 | for (size_t i = 0; i < s.size(); i += 4) { 96 | if (i) { 97 | if (i % 16 == 0) { 98 | new_s += "|"; 99 | } else if (i % 4 == 0) { 100 | new_s += "."; 101 | } 102 | } 103 | new_s += s.substr(i, 4); 104 | } 105 | return new_s; 106 | } 107 | 108 | void print_pd_first_two_words(const __m512i *pd, size_t tabs = 1) { 109 | uint64_t h0 = 0, h1 = 0; 110 | memcpy(&h0, pd, 8); 111 | memcpy(&h1, reinterpret_cast(pd) + 1, 8); 112 | auto s0 = format_word_to_string(h0, 64); 113 | auto s1 = format_word_to_string(h1, 64); 114 | 115 | auto tabs_to_add = std::string(tabs, '\t'); 116 | // size_t pops[2] = {_mm_popcnt_u64(h0), _mm_popcnt_u64(h1)}; 117 | std::cout << "h0: \t" + tabs_to_add << s0; 118 | std::cout << "\t|\t (" << _mm_popcnt_u64(h0) << ", " << (64 - _mm_popcnt_u64(h0)) << ")" << std::endl; 119 | std::cout << "h1: \t" + tabs_to_add << s1; 120 | std::cout << "\t|\t (" << _mm_popcnt_u64(h1) << ", " << (64 - _mm_popcnt_u64(h1)) << ")" << std::endl; 121 | } 122 | 123 | void print_pd(const __m512i *pd) { 124 | std::cout << std::string(80, '~') << std::endl; 125 | // assert(pd512::get_capacity(pd) == pd512::get_capacity_naive(pd)); 126 | std::cout << "pd capacity:" << get_cap(pd) << std::endl; 127 | // v_pd512_plus::print_headers_extended(pd); 128 | print_pd_first_two_words(pd); 129 | auto mp = ((const u8 *) pd) + 16; 130 | auto body_str = str_bitsMani::str_array_with_line_numbers(mp, MAX_CAP); 131 | std::cout << body_str << std::endl; 132 | std::cout << std::string(80, '~') << std::endl; 133 | } 134 | 135 | }// namespace tc_sym::check 136 | -------------------------------------------------------------------------------- /Tests/smart_tests.cpp: -------------------------------------------------------------------------------- 1 | #include "smart_tests.hpp" 2 | namespace testSmart { 3 | 4 | size_t count_uniques(std::vector *v) { 5 | std::sort(v->begin(), v->end()); 6 | auto uniqueCount = std::unique(v->begin(), v->end()) - v->begin(); 7 | return uniqueCount; 8 | } 9 | 10 | void vector_concatenate_and_shuffle(const std::vector *v1, const std::vector *v2, std::vector *res, std::mt19937_64 rng) { 11 | size_t all_size = v1->size() + v2->size(); 12 | res->resize(all_size); 13 | res->insert(res->end(), v1->begin(), v1->end()); 14 | res->insert(res->end(), v2->begin(), v2->end()); 15 | std::shuffle(res->begin(), res->end(), rng); 16 | } 17 | 18 | void weighted_vector_concatenate_and_shuffle(const std::vector *v_yes, const std::vector *v_uni, std::vector *res, double yes_div, std::mt19937_64 rng) { 19 | assert(yes_div <= 1); 20 | auto v_yes_items = std::ceil(v_yes->size() * yes_div); 21 | size_t all_size = v_yes_items + v_uni->size(); 22 | res->resize(all_size); 23 | res->insert(res->end(), v_yes->begin(), v_yes->begin() + v_yes_items); 24 | res->insert(res->end(), v_uni->begin(), v_uni->end()); 25 | std::shuffle(res->begin(), res->end(), rng); 26 | } 27 | 28 | void vector_concatenate_and_shuffle(const std::vector *v1, const std::vector *v2, std::vector *res) { 29 | std::uint_least64_t seed; 30 | sysrandom(&seed, sizeof(seed)); 31 | std::mt19937_64 new_rng(seed); 32 | vector_concatenate_and_shuffle(v1, v2, res, new_rng); 33 | } 34 | 35 | size_t test_shuffle_function(const std::vector *v1, const std::vector *v2, std::vector *res) { 36 | size_t all_size = v1->size() + v2->size(); 37 | res->resize(all_size); 38 | res->insert(res->end(), v1->begin(), v1->end()); 39 | res->insert(res->end(), v2->begin(), v2->end()); 40 | res->shrink_to_fit(); 41 | std::vector temp_vec(*res); 42 | for (size_t i = 0; i < 100; i++) { assert(temp_vec.at(i) == res->at(i)); } 43 | 44 | std::uint_least64_t seed; 45 | sysrandom(&seed, sizeof(seed)); 46 | std::mt19937_64 new_rng(seed); 47 | std::shuffle(res->begin(), res->end(), new_rng); 48 | new_rng(); 49 | // std::shuffle(res->begin(), res->end(), new_rng);new_rng(); 50 | // std::shuffle(res->begin(), res->end(), new_rng);new_rng(); 51 | // std::shuffle(res->begin(), res->end(), new_rng);new_rng(); 52 | 53 | size_t counter = 0; 54 | for (size_t i = 0; i < all_size; i++) { counter += (temp_vec.at(i) == res->at(i)); } 55 | 56 | auto u_count = count_uniques(&temp_vec); 57 | std::cout << "u_count: \t" << u_count << std::endl; 58 | auto ratio = (1.0 * u_count) / temp_vec.size(); 59 | std::cout << "ratio: \t" << ratio << std::endl; 60 | 61 | return counter; 62 | // assert 63 | } 64 | 65 | void print_vector(const std::vector *vec) { 66 | std::cout << vec->at(0);// << std::endl; 67 | for (size_t i = 1; i < vec->size(); i++) { 68 | std::cout << ", " << vec->at(i);// << std::endl; 69 | } 70 | std::cout << std::endl; 71 | } 72 | 73 | void print_vector(const std::vector *vec, size_t start, size_t end) { 74 | assert(start < end); 75 | assert(end < vec->size()); 76 | std::cout << vec->at(start);// << std::endl; 77 | for (size_t i = start + 1; i < end; i++) { 78 | std::cout << ", " << vec->at(i);// << std::endl; 79 | } 80 | std::cout << std::endl; 81 | } 82 | 83 | 84 | std::mt19937_64 fill_vec_smart(std::vector *vec, size_t number_of_elements) { 85 | 86 | std::uint_least64_t seed; 87 | sysrandom(&seed, sizeof(seed)); 88 | // if (1) { 89 | // std::cout << "seed is constant: " << 0xf1234'5678'9abc << std::endl; 90 | // seed = 0xf1234'5678'9abc; 91 | // } 92 | std::mt19937_64 rng(seed); 93 | std::uniform_int_distribution dist(0, UINT64_MAX); 94 | 95 | vec->resize(number_of_elements); 96 | for (size_t i = 0; i < number_of_elements; ++i) { 97 | vec->at(i) = dist(rng); 98 | } 99 | return rng; 100 | } 101 | 102 | void fill_vec_from_range_and_shuffle(size_t start, size_t end, size_t length, const std::vector *input_vec, std::vector *temp_vec, std::mt19937_64 rng) { 103 | assert(start < end); 104 | assert(start + length <= end); 105 | temp_vec->resize(end - start); 106 | 107 | for (size_t i = start; i < end; i++) { 108 | temp_vec->at(i - start) = input_vec->at(i); 109 | } 110 | std::shuffle(temp_vec->begin(), temp_vec->end(), rng); 111 | } 112 | 113 | void my_naive_sample(size_t start, size_t end, size_t length, const std::vector *input_vec, std::vector *temp_vec, std::mt19937_64 &rng) { 114 | std::uniform_int_distribution<> dis(start, end); 115 | for (size_t i = 0; i < length; i++) { 116 | u64 temp_item = input_vec->at(dis(rng)); 117 | temp_vec->at(i) = temp_item; 118 | } 119 | } 120 | 121 | void fill_vec_by_samples(size_t start, size_t end, size_t length, const std::vector *input_vec, std::vector *temp_vec, std::mt19937_64 rng) { 122 | std::uint_least64_t seed; 123 | sysrandom(&seed, sizeof(seed)); 124 | std::mt19937_64 new_rng(seed); 125 | assert(start < end); 126 | assert(start + length <= end); 127 | temp_vec->resize(length); 128 | // auto it_start = input_vec->begin() + start; 129 | // auto it_end = input_vec->begin() + end; 130 | // std::sample(it_start, it_end, temp_vec->begin(), length, new_rng); 131 | my_naive_sample(start, end, length, input_vec, temp_vec, new_rng); 132 | temp_vec->shrink_to_fit(); 133 | assert(temp_vec->size() == length); 134 | std::shuffle(temp_vec->begin(), temp_vec->end(), new_rng); 135 | } 136 | 137 | void fill_vec_by_samples(size_t start, size_t end, size_t length, const std::vector *input_vec, std::vector *temp_vec) { 138 | std::uint_least64_t seed; 139 | sysrandom(&seed, sizeof(seed)); 140 | std::mt19937_64 new_rng(seed); 141 | assert(start < end); 142 | assert(start + length <= end); 143 | temp_vec->resize(length); 144 | // auto it_start = input_vec->begin() + start; 145 | // auto it_end = input_vec->begin() + end; 146 | // std::sample(it_start, it_end, temp_vec->begin(), length, new_rng); 147 | my_naive_sample(start, end, length, input_vec, temp_vec, new_rng); 148 | 149 | temp_vec->shrink_to_fit(); 150 | assert(temp_vec->size() == length); 151 | std::shuffle(temp_vec->begin(), temp_vec->end(), new_rng); 152 | } 153 | 154 | void print_data(const u64 *data, size_t size, size_t bench_precision, size_t find_step) { 155 | const unsigned width = 12; 156 | const unsigned items_in_line = 4; 157 | const unsigned lines = bench_precision / items_in_line; 158 | for (size_t i = 0; i < lines; i++) { 159 | auto temp_sum = 0; 160 | size_t index = i * items_in_line; 161 | std::cout << i << ":\t" << std::setw(width) << ((1.0 * find_step) / (1.0 * data[index] / 1e9)); 162 | temp_sum += data[index]; 163 | for (size_t j = 1; j < items_in_line; j++) { 164 | std::cout << ", " << std::setw(width) << ((1.0 * find_step) / (1.0 * data[index + j] / 1e9)); 165 | temp_sum += data[index + j]; 166 | } 167 | std::cout << "|Average:\t" << ((1.0 * items_in_line * find_step) / (1.0 * temp_sum / 1e9)) << std::endl; 168 | // std::cout << std::endl; 169 | } 170 | } 171 | }// namespace testSmart 172 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/query/cache-v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomerEven/Prefix-Filter/f6efa59bd84365f301014c6eb40161cb21054b69/cmake-build-debug/.cmake/api/v1/query/cache-v2 -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/query/cmakeFiles-v1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomerEven/Prefix-Filter/f6efa59bd84365f301014c6eb40161cb21054b69/cmake-build-debug/.cmake/api/v1/query/cmakeFiles-v1 -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/query/codemodel-v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomerEven/Prefix-Filter/f6efa59bd84365f301014c6eb40161cb21054b69/cmake-build-debug/.cmake/api/v1/query/codemodel-v2 -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/query/toolchains-v1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomerEven/Prefix-Filter/f6efa59bd84365f301014c6eb40161cb21054b69/cmake-build-debug/.cmake/api/v1/query/toolchains-v1 -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/codemodel-v2-5879e526388a2efa61dd.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations" : 3 | [ 4 | { 5 | "directories" : 6 | [ 7 | { 8 | "build" : ".", 9 | "jsonFile" : "directory-.-Debug-f5ebdc15457944623624.json", 10 | "minimumCMakeVersion" : 11 | { 12 | "string" : "3.10" 13 | }, 14 | "projectIndex" : 0, 15 | "source" : ".", 16 | "targetIndexes" : 17 | [ 18 | 0, 19 | 1, 20 | 2, 21 | 3, 22 | 4, 23 | 5, 24 | 6, 25 | 7, 26 | 8, 27 | 9, 28 | 10 29 | ] 30 | } 31 | ], 32 | "name" : "Debug", 33 | "projects" : 34 | [ 35 | { 36 | "directoryIndexes" : 37 | [ 38 | 0 39 | ], 40 | "name" : "APD_ONLY", 41 | "targetIndexes" : 42 | [ 43 | 0, 44 | 1, 45 | 2, 46 | 3, 47 | 4, 48 | 5, 49 | 6, 50 | 7, 51 | 8, 52 | 9, 53 | 10 54 | ] 55 | } 56 | ], 57 | "targets" : 58 | [ 59 | { 60 | "directoryIndex" : 0, 61 | "id" : "example::@6890427a1f51a3e7e1df", 62 | "jsonFile" : "target-example-Debug-f2fd9bd66abbfca03f37.json", 63 | "name" : "example", 64 | "projectIndex" : 0 65 | }, 66 | { 67 | "directoryIndex" : 0, 68 | "id" : "example0::@6890427a1f51a3e7e1df", 69 | "jsonFile" : "target-example0-Debug-722e45bf24620d8a1287.json", 70 | "name" : "example0", 71 | "projectIndex" : 0 72 | }, 73 | { 74 | "directoryIndex" : 0, 75 | "id" : "measure_built::@6890427a1f51a3e7e1df", 76 | "jsonFile" : "target-measure_built-Debug-0ba116b65bf3d7ab6884.json", 77 | "name" : "measure_built", 78 | "projectIndex" : 0 79 | }, 80 | { 81 | "directoryIndex" : 0, 82 | "id" : "measure_built0::@6890427a1f51a3e7e1df", 83 | "jsonFile" : "target-measure_built0-Debug-1c26e7153ab9b4dbb397.json", 84 | "name" : "measure_built0", 85 | "projectIndex" : 0 86 | }, 87 | { 88 | "directoryIndex" : 0, 89 | "id" : "measure_built3::@6890427a1f51a3e7e1df", 90 | "jsonFile" : "target-measure_built3-Debug-9e60f0edabd112451332.json", 91 | "name" : "measure_built3", 92 | "projectIndex" : 0 93 | }, 94 | { 95 | "directoryIndex" : 0, 96 | "id" : "measure_fpp::@6890427a1f51a3e7e1df", 97 | "jsonFile" : "target-measure_fpp-Debug-6218804baa2d893c8235.json", 98 | "name" : "measure_fpp", 99 | "projectIndex" : 0 100 | }, 101 | { 102 | "directoryIndex" : 0, 103 | "id" : "measure_fpp0::@6890427a1f51a3e7e1df", 104 | "jsonFile" : "target-measure_fpp0-Debug-ae3e716da61914872325.json", 105 | "name" : "measure_fpp0", 106 | "projectIndex" : 0 107 | }, 108 | { 109 | "directoryIndex" : 0, 110 | "id" : "measure_fpp3::@6890427a1f51a3e7e1df", 111 | "jsonFile" : "target-measure_fpp3-Debug-12090f7133d04d45c993.json", 112 | "name" : "measure_fpp3", 113 | "projectIndex" : 0 114 | }, 115 | { 116 | "directoryIndex" : 0, 117 | "id" : "measure_perf::@6890427a1f51a3e7e1df", 118 | "jsonFile" : "target-measure_perf-Debug-a7f31f032634834b67c5.json", 119 | "name" : "measure_perf", 120 | "projectIndex" : 0 121 | }, 122 | { 123 | "directoryIndex" : 0, 124 | "id" : "measure_perf0::@6890427a1f51a3e7e1df", 125 | "jsonFile" : "target-measure_perf0-Debug-b41767523d8bde5ed7bd.json", 126 | "name" : "measure_perf0", 127 | "projectIndex" : 0 128 | }, 129 | { 130 | "directoryIndex" : 0, 131 | "id" : "measure_perf3::@6890427a1f51a3e7e1df", 132 | "jsonFile" : "target-measure_perf3-Debug-1815e855f242cbd76a5a.json", 133 | "name" : "measure_perf3", 134 | "projectIndex" : 0 135 | } 136 | ] 137 | } 138 | ], 139 | "kind" : "codemodel", 140 | "paths" : 141 | { 142 | "build" : "/home/tomer/Github/Public-PF/cmake-build-debug", 143 | "source" : "/home/tomer/Github/Public-PF" 144 | }, 145 | "version" : 146 | { 147 | "major" : 2, 148 | "minor" : 3 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/directory-.-Debug-f5ebdc15457944623624.json: -------------------------------------------------------------------------------- 1 | { 2 | "backtraceGraph" : 3 | { 4 | "commands" : [], 5 | "files" : [], 6 | "nodes" : [] 7 | }, 8 | "installers" : [], 9 | "paths" : 10 | { 11 | "build" : ".", 12 | "source" : "." 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/index-2022-03-18T10-15-38-0219.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake" : 3 | { 4 | "generator" : 5 | { 6 | "multiConfig" : false, 7 | "name" : "Ninja" 8 | }, 9 | "paths" : 10 | { 11 | "cmake" : "/snap/clion/184/bin/cmake/linux/bin/cmake", 12 | "cpack" : "/snap/clion/184/bin/cmake/linux/bin/cpack", 13 | "ctest" : "/snap/clion/184/bin/cmake/linux/bin/ctest", 14 | "root" : "/snap/clion/184/bin/cmake/linux/share/cmake-3.21" 15 | }, 16 | "version" : 17 | { 18 | "isDirty" : false, 19 | "major" : 3, 20 | "minor" : 21, 21 | "patch" : 1, 22 | "string" : "3.21.1", 23 | "suffix" : "" 24 | } 25 | }, 26 | "objects" : 27 | [ 28 | { 29 | "jsonFile" : "codemodel-v2-5879e526388a2efa61dd.json", 30 | "kind" : "codemodel", 31 | "version" : 32 | { 33 | "major" : 2, 34 | "minor" : 3 35 | } 36 | }, 37 | { 38 | "jsonFile" : "cache-v2-2dd2a3e80239b44d83cc.json", 39 | "kind" : "cache", 40 | "version" : 41 | { 42 | "major" : 2, 43 | "minor" : 0 44 | } 45 | }, 46 | { 47 | "jsonFile" : "cmakeFiles-v1-eb5f60b98dcb2065ce32.json", 48 | "kind" : "cmakeFiles", 49 | "version" : 50 | { 51 | "major" : 1, 52 | "minor" : 0 53 | } 54 | }, 55 | { 56 | "jsonFile" : "toolchains-v1-b0b7064a037a803f7bb5.json", 57 | "kind" : "toolchains", 58 | "version" : 59 | { 60 | "major" : 1, 61 | "minor" : 0 62 | } 63 | } 64 | ], 65 | "reply" : 66 | { 67 | "cache-v2" : 68 | { 69 | "jsonFile" : "cache-v2-2dd2a3e80239b44d83cc.json", 70 | "kind" : "cache", 71 | "version" : 72 | { 73 | "major" : 2, 74 | "minor" : 0 75 | } 76 | }, 77 | "cmakeFiles-v1" : 78 | { 79 | "jsonFile" : "cmakeFiles-v1-eb5f60b98dcb2065ce32.json", 80 | "kind" : "cmakeFiles", 81 | "version" : 82 | { 83 | "major" : 1, 84 | "minor" : 0 85 | } 86 | }, 87 | "codemodel-v2" : 88 | { 89 | "jsonFile" : "codemodel-v2-5879e526388a2efa61dd.json", 90 | "kind" : "codemodel", 91 | "version" : 92 | { 93 | "major" : 2, 94 | "minor" : 3 95 | } 96 | }, 97 | "toolchains-v1" : 98 | { 99 | "jsonFile" : "toolchains-v1-b0b7064a037a803f7bb5.json", 100 | "kind" : "toolchains", 101 | "version" : 102 | { 103 | "major" : 1, 104 | "minor" : 0 105 | } 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-example-Debug-f2fd9bd66abbfca03f37.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "example" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 111, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 113, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-Ofast" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-DNDEBUG" 54 | }, 55 | { 56 | "fragment" : "-std=gnu++17" 57 | } 58 | ], 59 | "language" : "CXX", 60 | "languageStandard" : 61 | { 62 | "backtraces" : 63 | [ 64 | 1 65 | ], 66 | "standard" : "17" 67 | }, 68 | "sourceIndexes" : 69 | [ 70 | 7, 71 | 9, 72 | 11, 73 | 14, 74 | 21, 75 | 23 76 | ] 77 | } 78 | ], 79 | "id" : "example::@6890427a1f51a3e7e1df", 80 | "link" : 81 | { 82 | "commandFragments" : 83 | [ 84 | { 85 | "fragment" : "-march=native -g", 86 | "role" : "flags" 87 | }, 88 | { 89 | "fragment" : "", 90 | "role" : "flags" 91 | } 92 | ], 93 | "language" : "CXX" 94 | }, 95 | "name" : "example", 96 | "nameOnDisk" : "example", 97 | "paths" : 98 | { 99 | "build" : ".", 100 | "source" : "." 101 | }, 102 | "sourceGroups" : 103 | [ 104 | { 105 | "name" : "Header Files", 106 | "sourceIndexes" : 107 | [ 108 | 0, 109 | 1, 110 | 2, 111 | 3, 112 | 4, 113 | 5, 114 | 6, 115 | 8, 116 | 10, 117 | 12, 118 | 13, 119 | 15, 120 | 16, 121 | 17, 122 | 18, 123 | 19, 124 | 20, 125 | 22 126 | ] 127 | }, 128 | { 129 | "name" : "Source Files", 130 | "sourceIndexes" : 131 | [ 132 | 7, 133 | 9, 134 | 11, 135 | 14, 136 | 21, 137 | 23 138 | ] 139 | } 140 | ], 141 | "sources" : 142 | [ 143 | { 144 | "backtrace" : 1, 145 | "path" : "Bloom_Filter/simd-block.h", 146 | "sourceGroupIndex" : 0 147 | }, 148 | { 149 | "backtrace" : 1, 150 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 151 | "sourceGroupIndex" : 0 152 | }, 153 | { 154 | "backtrace" : 1, 155 | "path" : "Bloom_Filter/Impala512.h", 156 | "sourceGroupIndex" : 0 157 | }, 158 | { 159 | "backtrace" : 1, 160 | "path" : "Bloom_Filter/bloom.hpp", 161 | "sourceGroupIndex" : 0 162 | }, 163 | { 164 | "backtrace" : 1, 165 | "path" : "hashutil.h", 166 | "sourceGroupIndex" : 0 167 | }, 168 | { 169 | "backtrace" : 1, 170 | "path" : "Tests/wrappers.hpp", 171 | "sourceGroupIndex" : 0 172 | }, 173 | { 174 | "backtrace" : 1, 175 | "path" : "Tests/smart_tests.hpp", 176 | "sourceGroupIndex" : 0 177 | }, 178 | { 179 | "backtrace" : 1, 180 | "compileGroupIndex" : 0, 181 | "path" : "Tests/smart_tests.cpp", 182 | "sourceGroupIndex" : 1 183 | }, 184 | { 185 | "backtrace" : 1, 186 | "path" : "Prefix-Filter/Shift_op.hpp", 187 | "sourceGroupIndex" : 0 188 | }, 189 | { 190 | "backtrace" : 1, 191 | "compileGroupIndex" : 0, 192 | "path" : "Prefix-Filter/Shift_op.cpp", 193 | "sourceGroupIndex" : 1 194 | }, 195 | { 196 | "backtrace" : 1, 197 | "path" : "Prefix-Filter/min_pd256.hpp", 198 | "sourceGroupIndex" : 0 199 | }, 200 | { 201 | "backtrace" : 1, 202 | "compileGroupIndex" : 0, 203 | "path" : "Prefix-Filter/min_pd256.cpp", 204 | "sourceGroupIndex" : 1 205 | }, 206 | { 207 | "backtrace" : 1, 208 | "path" : "cuckoofilter/src/bitsutil.h", 209 | "sourceGroupIndex" : 0 210 | }, 211 | { 212 | "backtrace" : 1, 213 | "path" : "cuckoofilter/src/permencoding.h", 214 | "sourceGroupIndex" : 0 215 | }, 216 | { 217 | "backtrace" : 1, 218 | "compileGroupIndex" : 0, 219 | "path" : "cuckoofilter/src/printutil.cc", 220 | "sourceGroupIndex" : 1 221 | }, 222 | { 223 | "backtrace" : 1, 224 | "path" : "cuckoofilter/src/debug.h", 225 | "sourceGroupIndex" : 0 226 | }, 227 | { 228 | "backtrace" : 1, 229 | "path" : "cuckoofilter/src/singletable.h", 230 | "sourceGroupIndex" : 0 231 | }, 232 | { 233 | "backtrace" : 1, 234 | "path" : "cuckoofilter/src/packedtable.h", 235 | "sourceGroupIndex" : 0 236 | }, 237 | { 238 | "backtrace" : 1, 239 | "path" : "cuckoofilter/src/cuckoofilter.h", 240 | "sourceGroupIndex" : 0 241 | }, 242 | { 243 | "backtrace" : 1, 244 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 245 | "sourceGroupIndex" : 0 246 | }, 247 | { 248 | "backtrace" : 1, 249 | "path" : "TC-Shortcut/tc-sym.hpp", 250 | "sourceGroupIndex" : 0 251 | }, 252 | { 253 | "backtrace" : 1, 254 | "compileGroupIndex" : 0, 255 | "path" : "TC-Shortcut/tc-sym.cpp", 256 | "sourceGroupIndex" : 1 257 | }, 258 | { 259 | "backtrace" : 1, 260 | "path" : "TC-Shortcut/TC-shortcut.hpp", 261 | "sourceGroupIndex" : 0 262 | }, 263 | { 264 | "backtrace" : 1, 265 | "compileGroupIndex" : 0, 266 | "path" : "example.cpp", 267 | "sourceGroupIndex" : 1 268 | } 269 | ], 270 | "type" : "EXECUTABLE" 271 | } 272 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-example0-Debug-722e45bf24620d8a1287.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "example0" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 110, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 112, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-O0" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-g3" 54 | }, 55 | { 56 | "backtrace" : 2, 57 | "fragment" : "-W" 58 | }, 59 | { 60 | "fragment" : "-std=gnu++17" 61 | } 62 | ], 63 | "language" : "CXX", 64 | "languageStandard" : 65 | { 66 | "backtraces" : 67 | [ 68 | 1 69 | ], 70 | "standard" : "17" 71 | }, 72 | "sourceIndexes" : 73 | [ 74 | 7, 75 | 9, 76 | 11, 77 | 14, 78 | 21, 79 | 23 80 | ] 81 | } 82 | ], 83 | "id" : "example0::@6890427a1f51a3e7e1df", 84 | "link" : 85 | { 86 | "commandFragments" : 87 | [ 88 | { 89 | "fragment" : "-march=native -g", 90 | "role" : "flags" 91 | }, 92 | { 93 | "fragment" : "", 94 | "role" : "flags" 95 | } 96 | ], 97 | "language" : "CXX" 98 | }, 99 | "name" : "example0", 100 | "nameOnDisk" : "example0", 101 | "paths" : 102 | { 103 | "build" : ".", 104 | "source" : "." 105 | }, 106 | "sourceGroups" : 107 | [ 108 | { 109 | "name" : "Header Files", 110 | "sourceIndexes" : 111 | [ 112 | 0, 113 | 1, 114 | 2, 115 | 3, 116 | 4, 117 | 5, 118 | 6, 119 | 8, 120 | 10, 121 | 12, 122 | 13, 123 | 15, 124 | 16, 125 | 17, 126 | 18, 127 | 19, 128 | 20, 129 | 22 130 | ] 131 | }, 132 | { 133 | "name" : "Source Files", 134 | "sourceIndexes" : 135 | [ 136 | 7, 137 | 9, 138 | 11, 139 | 14, 140 | 21, 141 | 23 142 | ] 143 | } 144 | ], 145 | "sources" : 146 | [ 147 | { 148 | "backtrace" : 1, 149 | "path" : "Bloom_Filter/simd-block.h", 150 | "sourceGroupIndex" : 0 151 | }, 152 | { 153 | "backtrace" : 1, 154 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 155 | "sourceGroupIndex" : 0 156 | }, 157 | { 158 | "backtrace" : 1, 159 | "path" : "Bloom_Filter/Impala512.h", 160 | "sourceGroupIndex" : 0 161 | }, 162 | { 163 | "backtrace" : 1, 164 | "path" : "Bloom_Filter/bloom.hpp", 165 | "sourceGroupIndex" : 0 166 | }, 167 | { 168 | "backtrace" : 1, 169 | "path" : "hashutil.h", 170 | "sourceGroupIndex" : 0 171 | }, 172 | { 173 | "backtrace" : 1, 174 | "path" : "Tests/wrappers.hpp", 175 | "sourceGroupIndex" : 0 176 | }, 177 | { 178 | "backtrace" : 1, 179 | "path" : "Tests/smart_tests.hpp", 180 | "sourceGroupIndex" : 0 181 | }, 182 | { 183 | "backtrace" : 1, 184 | "compileGroupIndex" : 0, 185 | "path" : "Tests/smart_tests.cpp", 186 | "sourceGroupIndex" : 1 187 | }, 188 | { 189 | "backtrace" : 1, 190 | "path" : "Prefix-Filter/Shift_op.hpp", 191 | "sourceGroupIndex" : 0 192 | }, 193 | { 194 | "backtrace" : 1, 195 | "compileGroupIndex" : 0, 196 | "path" : "Prefix-Filter/Shift_op.cpp", 197 | "sourceGroupIndex" : 1 198 | }, 199 | { 200 | "backtrace" : 1, 201 | "path" : "Prefix-Filter/min_pd256.hpp", 202 | "sourceGroupIndex" : 0 203 | }, 204 | { 205 | "backtrace" : 1, 206 | "compileGroupIndex" : 0, 207 | "path" : "Prefix-Filter/min_pd256.cpp", 208 | "sourceGroupIndex" : 1 209 | }, 210 | { 211 | "backtrace" : 1, 212 | "path" : "cuckoofilter/src/bitsutil.h", 213 | "sourceGroupIndex" : 0 214 | }, 215 | { 216 | "backtrace" : 1, 217 | "path" : "cuckoofilter/src/permencoding.h", 218 | "sourceGroupIndex" : 0 219 | }, 220 | { 221 | "backtrace" : 1, 222 | "compileGroupIndex" : 0, 223 | "path" : "cuckoofilter/src/printutil.cc", 224 | "sourceGroupIndex" : 1 225 | }, 226 | { 227 | "backtrace" : 1, 228 | "path" : "cuckoofilter/src/debug.h", 229 | "sourceGroupIndex" : 0 230 | }, 231 | { 232 | "backtrace" : 1, 233 | "path" : "cuckoofilter/src/singletable.h", 234 | "sourceGroupIndex" : 0 235 | }, 236 | { 237 | "backtrace" : 1, 238 | "path" : "cuckoofilter/src/packedtable.h", 239 | "sourceGroupIndex" : 0 240 | }, 241 | { 242 | "backtrace" : 1, 243 | "path" : "cuckoofilter/src/cuckoofilter.h", 244 | "sourceGroupIndex" : 0 245 | }, 246 | { 247 | "backtrace" : 1, 248 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 249 | "sourceGroupIndex" : 0 250 | }, 251 | { 252 | "backtrace" : 1, 253 | "path" : "TC-Shortcut/tc-sym.hpp", 254 | "sourceGroupIndex" : 0 255 | }, 256 | { 257 | "backtrace" : 1, 258 | "compileGroupIndex" : 0, 259 | "path" : "TC-Shortcut/tc-sym.cpp", 260 | "sourceGroupIndex" : 1 261 | }, 262 | { 263 | "backtrace" : 1, 264 | "path" : "TC-Shortcut/TC-shortcut.hpp", 265 | "sourceGroupIndex" : 0 266 | }, 267 | { 268 | "backtrace" : 1, 269 | "compileGroupIndex" : 0, 270 | "path" : "example.cpp", 271 | "sourceGroupIndex" : 1 272 | } 273 | ], 274 | "type" : "EXECUTABLE" 275 | } 276 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-measure_built-Debug-0ba116b65bf3d7ab6884.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "measure_built" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 82, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 85, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-Ofast" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-DNDEBUG" 54 | }, 55 | { 56 | "fragment" : "-std=gnu++17" 57 | } 58 | ], 59 | "language" : "CXX", 60 | "languageStandard" : 61 | { 62 | "backtraces" : 63 | [ 64 | 1 65 | ], 66 | "standard" : "17" 67 | }, 68 | "sourceIndexes" : 69 | [ 70 | 7, 71 | 9, 72 | 11, 73 | 14, 74 | 21, 75 | 23 76 | ] 77 | } 78 | ], 79 | "id" : "measure_built::@6890427a1f51a3e7e1df", 80 | "link" : 81 | { 82 | "commandFragments" : 83 | [ 84 | { 85 | "fragment" : "-march=native -g", 86 | "role" : "flags" 87 | }, 88 | { 89 | "fragment" : "", 90 | "role" : "flags" 91 | } 92 | ], 93 | "language" : "CXX" 94 | }, 95 | "name" : "measure_built", 96 | "nameOnDisk" : "measure_built", 97 | "paths" : 98 | { 99 | "build" : ".", 100 | "source" : "." 101 | }, 102 | "sourceGroups" : 103 | [ 104 | { 105 | "name" : "Header Files", 106 | "sourceIndexes" : 107 | [ 108 | 0, 109 | 1, 110 | 2, 111 | 3, 112 | 4, 113 | 5, 114 | 6, 115 | 8, 116 | 10, 117 | 12, 118 | 13, 119 | 15, 120 | 16, 121 | 17, 122 | 18, 123 | 19, 124 | 20, 125 | 22 126 | ] 127 | }, 128 | { 129 | "name" : "Source Files", 130 | "sourceIndexes" : 131 | [ 132 | 7, 133 | 9, 134 | 11, 135 | 14, 136 | 21, 137 | 23 138 | ] 139 | } 140 | ], 141 | "sources" : 142 | [ 143 | { 144 | "backtrace" : 1, 145 | "path" : "Bloom_Filter/simd-block.h", 146 | "sourceGroupIndex" : 0 147 | }, 148 | { 149 | "backtrace" : 1, 150 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 151 | "sourceGroupIndex" : 0 152 | }, 153 | { 154 | "backtrace" : 1, 155 | "path" : "Bloom_Filter/Impala512.h", 156 | "sourceGroupIndex" : 0 157 | }, 158 | { 159 | "backtrace" : 1, 160 | "path" : "Bloom_Filter/bloom.hpp", 161 | "sourceGroupIndex" : 0 162 | }, 163 | { 164 | "backtrace" : 1, 165 | "path" : "hashutil.h", 166 | "sourceGroupIndex" : 0 167 | }, 168 | { 169 | "backtrace" : 1, 170 | "path" : "Tests/wrappers.hpp", 171 | "sourceGroupIndex" : 0 172 | }, 173 | { 174 | "backtrace" : 1, 175 | "path" : "Tests/smart_tests.hpp", 176 | "sourceGroupIndex" : 0 177 | }, 178 | { 179 | "backtrace" : 1, 180 | "compileGroupIndex" : 0, 181 | "path" : "Tests/smart_tests.cpp", 182 | "sourceGroupIndex" : 1 183 | }, 184 | { 185 | "backtrace" : 1, 186 | "path" : "Prefix-Filter/Shift_op.hpp", 187 | "sourceGroupIndex" : 0 188 | }, 189 | { 190 | "backtrace" : 1, 191 | "compileGroupIndex" : 0, 192 | "path" : "Prefix-Filter/Shift_op.cpp", 193 | "sourceGroupIndex" : 1 194 | }, 195 | { 196 | "backtrace" : 1, 197 | "path" : "Prefix-Filter/min_pd256.hpp", 198 | "sourceGroupIndex" : 0 199 | }, 200 | { 201 | "backtrace" : 1, 202 | "compileGroupIndex" : 0, 203 | "path" : "Prefix-Filter/min_pd256.cpp", 204 | "sourceGroupIndex" : 1 205 | }, 206 | { 207 | "backtrace" : 1, 208 | "path" : "cuckoofilter/src/bitsutil.h", 209 | "sourceGroupIndex" : 0 210 | }, 211 | { 212 | "backtrace" : 1, 213 | "path" : "cuckoofilter/src/permencoding.h", 214 | "sourceGroupIndex" : 0 215 | }, 216 | { 217 | "backtrace" : 1, 218 | "compileGroupIndex" : 0, 219 | "path" : "cuckoofilter/src/printutil.cc", 220 | "sourceGroupIndex" : 1 221 | }, 222 | { 223 | "backtrace" : 1, 224 | "path" : "cuckoofilter/src/debug.h", 225 | "sourceGroupIndex" : 0 226 | }, 227 | { 228 | "backtrace" : 1, 229 | "path" : "cuckoofilter/src/singletable.h", 230 | "sourceGroupIndex" : 0 231 | }, 232 | { 233 | "backtrace" : 1, 234 | "path" : "cuckoofilter/src/packedtable.h", 235 | "sourceGroupIndex" : 0 236 | }, 237 | { 238 | "backtrace" : 1, 239 | "path" : "cuckoofilter/src/cuckoofilter.h", 240 | "sourceGroupIndex" : 0 241 | }, 242 | { 243 | "backtrace" : 1, 244 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 245 | "sourceGroupIndex" : 0 246 | }, 247 | { 248 | "backtrace" : 1, 249 | "path" : "TC-Shortcut/tc-sym.hpp", 250 | "sourceGroupIndex" : 0 251 | }, 252 | { 253 | "backtrace" : 1, 254 | "compileGroupIndex" : 0, 255 | "path" : "TC-Shortcut/tc-sym.cpp", 256 | "sourceGroupIndex" : 1 257 | }, 258 | { 259 | "backtrace" : 1, 260 | "path" : "TC-Shortcut/TC-shortcut.hpp", 261 | "sourceGroupIndex" : 0 262 | }, 263 | { 264 | "backtrace" : 1, 265 | "compileGroupIndex" : 0, 266 | "path" : "main-built.cpp", 267 | "sourceGroupIndex" : 1 268 | } 269 | ], 270 | "type" : "EXECUTABLE" 271 | } 272 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-measure_built0-Debug-1c26e7153ab9b4dbb397.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "measure_built0" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 80, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 83, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-O0" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-g3" 54 | }, 55 | { 56 | "backtrace" : 2, 57 | "fragment" : "-W" 58 | }, 59 | { 60 | "fragment" : "-std=gnu++17" 61 | } 62 | ], 63 | "language" : "CXX", 64 | "languageStandard" : 65 | { 66 | "backtraces" : 67 | [ 68 | 1 69 | ], 70 | "standard" : "17" 71 | }, 72 | "sourceIndexes" : 73 | [ 74 | 7, 75 | 9, 76 | 11, 77 | 14, 78 | 21, 79 | 23 80 | ] 81 | } 82 | ], 83 | "id" : "measure_built0::@6890427a1f51a3e7e1df", 84 | "link" : 85 | { 86 | "commandFragments" : 87 | [ 88 | { 89 | "fragment" : "-march=native -g", 90 | "role" : "flags" 91 | }, 92 | { 93 | "fragment" : "", 94 | "role" : "flags" 95 | } 96 | ], 97 | "language" : "CXX" 98 | }, 99 | "name" : "measure_built0", 100 | "nameOnDisk" : "measure_built0", 101 | "paths" : 102 | { 103 | "build" : ".", 104 | "source" : "." 105 | }, 106 | "sourceGroups" : 107 | [ 108 | { 109 | "name" : "Header Files", 110 | "sourceIndexes" : 111 | [ 112 | 0, 113 | 1, 114 | 2, 115 | 3, 116 | 4, 117 | 5, 118 | 6, 119 | 8, 120 | 10, 121 | 12, 122 | 13, 123 | 15, 124 | 16, 125 | 17, 126 | 18, 127 | 19, 128 | 20, 129 | 22 130 | ] 131 | }, 132 | { 133 | "name" : "Source Files", 134 | "sourceIndexes" : 135 | [ 136 | 7, 137 | 9, 138 | 11, 139 | 14, 140 | 21, 141 | 23 142 | ] 143 | } 144 | ], 145 | "sources" : 146 | [ 147 | { 148 | "backtrace" : 1, 149 | "path" : "Bloom_Filter/simd-block.h", 150 | "sourceGroupIndex" : 0 151 | }, 152 | { 153 | "backtrace" : 1, 154 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 155 | "sourceGroupIndex" : 0 156 | }, 157 | { 158 | "backtrace" : 1, 159 | "path" : "Bloom_Filter/Impala512.h", 160 | "sourceGroupIndex" : 0 161 | }, 162 | { 163 | "backtrace" : 1, 164 | "path" : "Bloom_Filter/bloom.hpp", 165 | "sourceGroupIndex" : 0 166 | }, 167 | { 168 | "backtrace" : 1, 169 | "path" : "hashutil.h", 170 | "sourceGroupIndex" : 0 171 | }, 172 | { 173 | "backtrace" : 1, 174 | "path" : "Tests/wrappers.hpp", 175 | "sourceGroupIndex" : 0 176 | }, 177 | { 178 | "backtrace" : 1, 179 | "path" : "Tests/smart_tests.hpp", 180 | "sourceGroupIndex" : 0 181 | }, 182 | { 183 | "backtrace" : 1, 184 | "compileGroupIndex" : 0, 185 | "path" : "Tests/smart_tests.cpp", 186 | "sourceGroupIndex" : 1 187 | }, 188 | { 189 | "backtrace" : 1, 190 | "path" : "Prefix-Filter/Shift_op.hpp", 191 | "sourceGroupIndex" : 0 192 | }, 193 | { 194 | "backtrace" : 1, 195 | "compileGroupIndex" : 0, 196 | "path" : "Prefix-Filter/Shift_op.cpp", 197 | "sourceGroupIndex" : 1 198 | }, 199 | { 200 | "backtrace" : 1, 201 | "path" : "Prefix-Filter/min_pd256.hpp", 202 | "sourceGroupIndex" : 0 203 | }, 204 | { 205 | "backtrace" : 1, 206 | "compileGroupIndex" : 0, 207 | "path" : "Prefix-Filter/min_pd256.cpp", 208 | "sourceGroupIndex" : 1 209 | }, 210 | { 211 | "backtrace" : 1, 212 | "path" : "cuckoofilter/src/bitsutil.h", 213 | "sourceGroupIndex" : 0 214 | }, 215 | { 216 | "backtrace" : 1, 217 | "path" : "cuckoofilter/src/permencoding.h", 218 | "sourceGroupIndex" : 0 219 | }, 220 | { 221 | "backtrace" : 1, 222 | "compileGroupIndex" : 0, 223 | "path" : "cuckoofilter/src/printutil.cc", 224 | "sourceGroupIndex" : 1 225 | }, 226 | { 227 | "backtrace" : 1, 228 | "path" : "cuckoofilter/src/debug.h", 229 | "sourceGroupIndex" : 0 230 | }, 231 | { 232 | "backtrace" : 1, 233 | "path" : "cuckoofilter/src/singletable.h", 234 | "sourceGroupIndex" : 0 235 | }, 236 | { 237 | "backtrace" : 1, 238 | "path" : "cuckoofilter/src/packedtable.h", 239 | "sourceGroupIndex" : 0 240 | }, 241 | { 242 | "backtrace" : 1, 243 | "path" : "cuckoofilter/src/cuckoofilter.h", 244 | "sourceGroupIndex" : 0 245 | }, 246 | { 247 | "backtrace" : 1, 248 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 249 | "sourceGroupIndex" : 0 250 | }, 251 | { 252 | "backtrace" : 1, 253 | "path" : "TC-Shortcut/tc-sym.hpp", 254 | "sourceGroupIndex" : 0 255 | }, 256 | { 257 | "backtrace" : 1, 258 | "compileGroupIndex" : 0, 259 | "path" : "TC-Shortcut/tc-sym.cpp", 260 | "sourceGroupIndex" : 1 261 | }, 262 | { 263 | "backtrace" : 1, 264 | "path" : "TC-Shortcut/TC-shortcut.hpp", 265 | "sourceGroupIndex" : 0 266 | }, 267 | { 268 | "backtrace" : 1, 269 | "compileGroupIndex" : 0, 270 | "path" : "main-built.cpp", 271 | "sourceGroupIndex" : 1 272 | } 273 | ], 274 | "type" : "EXECUTABLE" 275 | } 276 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-measure_built3-Debug-9e60f0edabd112451332.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "measure_built3" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 81, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 84, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-O3" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-g3" 54 | }, 55 | { 56 | "fragment" : "-std=gnu++17" 57 | } 58 | ], 59 | "language" : "CXX", 60 | "languageStandard" : 61 | { 62 | "backtraces" : 63 | [ 64 | 1 65 | ], 66 | "standard" : "17" 67 | }, 68 | "sourceIndexes" : 69 | [ 70 | 7, 71 | 9, 72 | 11, 73 | 14, 74 | 21, 75 | 23 76 | ] 77 | } 78 | ], 79 | "id" : "measure_built3::@6890427a1f51a3e7e1df", 80 | "link" : 81 | { 82 | "commandFragments" : 83 | [ 84 | { 85 | "fragment" : "-march=native -g", 86 | "role" : "flags" 87 | }, 88 | { 89 | "fragment" : "", 90 | "role" : "flags" 91 | } 92 | ], 93 | "language" : "CXX" 94 | }, 95 | "name" : "measure_built3", 96 | "nameOnDisk" : "measure_built3", 97 | "paths" : 98 | { 99 | "build" : ".", 100 | "source" : "." 101 | }, 102 | "sourceGroups" : 103 | [ 104 | { 105 | "name" : "Header Files", 106 | "sourceIndexes" : 107 | [ 108 | 0, 109 | 1, 110 | 2, 111 | 3, 112 | 4, 113 | 5, 114 | 6, 115 | 8, 116 | 10, 117 | 12, 118 | 13, 119 | 15, 120 | 16, 121 | 17, 122 | 18, 123 | 19, 124 | 20, 125 | 22 126 | ] 127 | }, 128 | { 129 | "name" : "Source Files", 130 | "sourceIndexes" : 131 | [ 132 | 7, 133 | 9, 134 | 11, 135 | 14, 136 | 21, 137 | 23 138 | ] 139 | } 140 | ], 141 | "sources" : 142 | [ 143 | { 144 | "backtrace" : 1, 145 | "path" : "Bloom_Filter/simd-block.h", 146 | "sourceGroupIndex" : 0 147 | }, 148 | { 149 | "backtrace" : 1, 150 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 151 | "sourceGroupIndex" : 0 152 | }, 153 | { 154 | "backtrace" : 1, 155 | "path" : "Bloom_Filter/Impala512.h", 156 | "sourceGroupIndex" : 0 157 | }, 158 | { 159 | "backtrace" : 1, 160 | "path" : "Bloom_Filter/bloom.hpp", 161 | "sourceGroupIndex" : 0 162 | }, 163 | { 164 | "backtrace" : 1, 165 | "path" : "hashutil.h", 166 | "sourceGroupIndex" : 0 167 | }, 168 | { 169 | "backtrace" : 1, 170 | "path" : "Tests/wrappers.hpp", 171 | "sourceGroupIndex" : 0 172 | }, 173 | { 174 | "backtrace" : 1, 175 | "path" : "Tests/smart_tests.hpp", 176 | "sourceGroupIndex" : 0 177 | }, 178 | { 179 | "backtrace" : 1, 180 | "compileGroupIndex" : 0, 181 | "path" : "Tests/smart_tests.cpp", 182 | "sourceGroupIndex" : 1 183 | }, 184 | { 185 | "backtrace" : 1, 186 | "path" : "Prefix-Filter/Shift_op.hpp", 187 | "sourceGroupIndex" : 0 188 | }, 189 | { 190 | "backtrace" : 1, 191 | "compileGroupIndex" : 0, 192 | "path" : "Prefix-Filter/Shift_op.cpp", 193 | "sourceGroupIndex" : 1 194 | }, 195 | { 196 | "backtrace" : 1, 197 | "path" : "Prefix-Filter/min_pd256.hpp", 198 | "sourceGroupIndex" : 0 199 | }, 200 | { 201 | "backtrace" : 1, 202 | "compileGroupIndex" : 0, 203 | "path" : "Prefix-Filter/min_pd256.cpp", 204 | "sourceGroupIndex" : 1 205 | }, 206 | { 207 | "backtrace" : 1, 208 | "path" : "cuckoofilter/src/bitsutil.h", 209 | "sourceGroupIndex" : 0 210 | }, 211 | { 212 | "backtrace" : 1, 213 | "path" : "cuckoofilter/src/permencoding.h", 214 | "sourceGroupIndex" : 0 215 | }, 216 | { 217 | "backtrace" : 1, 218 | "compileGroupIndex" : 0, 219 | "path" : "cuckoofilter/src/printutil.cc", 220 | "sourceGroupIndex" : 1 221 | }, 222 | { 223 | "backtrace" : 1, 224 | "path" : "cuckoofilter/src/debug.h", 225 | "sourceGroupIndex" : 0 226 | }, 227 | { 228 | "backtrace" : 1, 229 | "path" : "cuckoofilter/src/singletable.h", 230 | "sourceGroupIndex" : 0 231 | }, 232 | { 233 | "backtrace" : 1, 234 | "path" : "cuckoofilter/src/packedtable.h", 235 | "sourceGroupIndex" : 0 236 | }, 237 | { 238 | "backtrace" : 1, 239 | "path" : "cuckoofilter/src/cuckoofilter.h", 240 | "sourceGroupIndex" : 0 241 | }, 242 | { 243 | "backtrace" : 1, 244 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 245 | "sourceGroupIndex" : 0 246 | }, 247 | { 248 | "backtrace" : 1, 249 | "path" : "TC-Shortcut/tc-sym.hpp", 250 | "sourceGroupIndex" : 0 251 | }, 252 | { 253 | "backtrace" : 1, 254 | "compileGroupIndex" : 0, 255 | "path" : "TC-Shortcut/tc-sym.cpp", 256 | "sourceGroupIndex" : 1 257 | }, 258 | { 259 | "backtrace" : 1, 260 | "path" : "TC-Shortcut/TC-shortcut.hpp", 261 | "sourceGroupIndex" : 0 262 | }, 263 | { 264 | "backtrace" : 1, 265 | "compileGroupIndex" : 0, 266 | "path" : "main-built.cpp", 267 | "sourceGroupIndex" : 1 268 | } 269 | ], 270 | "type" : "EXECUTABLE" 271 | } 272 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-measure_fpp-Debug-6218804baa2d893c8235.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "measure_fpp" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 92, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 95, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-Ofast" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-DNDEBUG" 54 | }, 55 | { 56 | "fragment" : "-std=gnu++17" 57 | } 58 | ], 59 | "language" : "CXX", 60 | "languageStandard" : 61 | { 62 | "backtraces" : 63 | [ 64 | 1 65 | ], 66 | "standard" : "17" 67 | }, 68 | "sourceIndexes" : 69 | [ 70 | 7, 71 | 9, 72 | 11, 73 | 14, 74 | 21, 75 | 23 76 | ] 77 | } 78 | ], 79 | "id" : "measure_fpp::@6890427a1f51a3e7e1df", 80 | "link" : 81 | { 82 | "commandFragments" : 83 | [ 84 | { 85 | "fragment" : "-march=native -g", 86 | "role" : "flags" 87 | }, 88 | { 89 | "fragment" : "", 90 | "role" : "flags" 91 | } 92 | ], 93 | "language" : "CXX" 94 | }, 95 | "name" : "measure_fpp", 96 | "nameOnDisk" : "measure_fpp", 97 | "paths" : 98 | { 99 | "build" : ".", 100 | "source" : "." 101 | }, 102 | "sourceGroups" : 103 | [ 104 | { 105 | "name" : "Header Files", 106 | "sourceIndexes" : 107 | [ 108 | 0, 109 | 1, 110 | 2, 111 | 3, 112 | 4, 113 | 5, 114 | 6, 115 | 8, 116 | 10, 117 | 12, 118 | 13, 119 | 15, 120 | 16, 121 | 17, 122 | 18, 123 | 19, 124 | 20, 125 | 22 126 | ] 127 | }, 128 | { 129 | "name" : "Source Files", 130 | "sourceIndexes" : 131 | [ 132 | 7, 133 | 9, 134 | 11, 135 | 14, 136 | 21, 137 | 23 138 | ] 139 | } 140 | ], 141 | "sources" : 142 | [ 143 | { 144 | "backtrace" : 1, 145 | "path" : "Bloom_Filter/simd-block.h", 146 | "sourceGroupIndex" : 0 147 | }, 148 | { 149 | "backtrace" : 1, 150 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 151 | "sourceGroupIndex" : 0 152 | }, 153 | { 154 | "backtrace" : 1, 155 | "path" : "Bloom_Filter/Impala512.h", 156 | "sourceGroupIndex" : 0 157 | }, 158 | { 159 | "backtrace" : 1, 160 | "path" : "Bloom_Filter/bloom.hpp", 161 | "sourceGroupIndex" : 0 162 | }, 163 | { 164 | "backtrace" : 1, 165 | "path" : "hashutil.h", 166 | "sourceGroupIndex" : 0 167 | }, 168 | { 169 | "backtrace" : 1, 170 | "path" : "Tests/wrappers.hpp", 171 | "sourceGroupIndex" : 0 172 | }, 173 | { 174 | "backtrace" : 1, 175 | "path" : "Tests/smart_tests.hpp", 176 | "sourceGroupIndex" : 0 177 | }, 178 | { 179 | "backtrace" : 1, 180 | "compileGroupIndex" : 0, 181 | "path" : "Tests/smart_tests.cpp", 182 | "sourceGroupIndex" : 1 183 | }, 184 | { 185 | "backtrace" : 1, 186 | "path" : "Prefix-Filter/Shift_op.hpp", 187 | "sourceGroupIndex" : 0 188 | }, 189 | { 190 | "backtrace" : 1, 191 | "compileGroupIndex" : 0, 192 | "path" : "Prefix-Filter/Shift_op.cpp", 193 | "sourceGroupIndex" : 1 194 | }, 195 | { 196 | "backtrace" : 1, 197 | "path" : "Prefix-Filter/min_pd256.hpp", 198 | "sourceGroupIndex" : 0 199 | }, 200 | { 201 | "backtrace" : 1, 202 | "compileGroupIndex" : 0, 203 | "path" : "Prefix-Filter/min_pd256.cpp", 204 | "sourceGroupIndex" : 1 205 | }, 206 | { 207 | "backtrace" : 1, 208 | "path" : "cuckoofilter/src/bitsutil.h", 209 | "sourceGroupIndex" : 0 210 | }, 211 | { 212 | "backtrace" : 1, 213 | "path" : "cuckoofilter/src/permencoding.h", 214 | "sourceGroupIndex" : 0 215 | }, 216 | { 217 | "backtrace" : 1, 218 | "compileGroupIndex" : 0, 219 | "path" : "cuckoofilter/src/printutil.cc", 220 | "sourceGroupIndex" : 1 221 | }, 222 | { 223 | "backtrace" : 1, 224 | "path" : "cuckoofilter/src/debug.h", 225 | "sourceGroupIndex" : 0 226 | }, 227 | { 228 | "backtrace" : 1, 229 | "path" : "cuckoofilter/src/singletable.h", 230 | "sourceGroupIndex" : 0 231 | }, 232 | { 233 | "backtrace" : 1, 234 | "path" : "cuckoofilter/src/packedtable.h", 235 | "sourceGroupIndex" : 0 236 | }, 237 | { 238 | "backtrace" : 1, 239 | "path" : "cuckoofilter/src/cuckoofilter.h", 240 | "sourceGroupIndex" : 0 241 | }, 242 | { 243 | "backtrace" : 1, 244 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 245 | "sourceGroupIndex" : 0 246 | }, 247 | { 248 | "backtrace" : 1, 249 | "path" : "TC-Shortcut/tc-sym.hpp", 250 | "sourceGroupIndex" : 0 251 | }, 252 | { 253 | "backtrace" : 1, 254 | "compileGroupIndex" : 0, 255 | "path" : "TC-Shortcut/tc-sym.cpp", 256 | "sourceGroupIndex" : 1 257 | }, 258 | { 259 | "backtrace" : 1, 260 | "path" : "TC-Shortcut/TC-shortcut.hpp", 261 | "sourceGroupIndex" : 0 262 | }, 263 | { 264 | "backtrace" : 1, 265 | "compileGroupIndex" : 0, 266 | "path" : "main-fpp.cpp", 267 | "sourceGroupIndex" : 1 268 | } 269 | ], 270 | "type" : "EXECUTABLE" 271 | } 272 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-measure_fpp0-Debug-ae3e716da61914872325.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "measure_fpp0" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 90, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 93, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-O0" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-g3" 54 | }, 55 | { 56 | "backtrace" : 2, 57 | "fragment" : "-W" 58 | }, 59 | { 60 | "fragment" : "-std=gnu++17" 61 | } 62 | ], 63 | "language" : "CXX", 64 | "languageStandard" : 65 | { 66 | "backtraces" : 67 | [ 68 | 1 69 | ], 70 | "standard" : "17" 71 | }, 72 | "sourceIndexes" : 73 | [ 74 | 7, 75 | 9, 76 | 11, 77 | 14, 78 | 21, 79 | 23 80 | ] 81 | } 82 | ], 83 | "id" : "measure_fpp0::@6890427a1f51a3e7e1df", 84 | "link" : 85 | { 86 | "commandFragments" : 87 | [ 88 | { 89 | "fragment" : "-march=native -g", 90 | "role" : "flags" 91 | }, 92 | { 93 | "fragment" : "", 94 | "role" : "flags" 95 | } 96 | ], 97 | "language" : "CXX" 98 | }, 99 | "name" : "measure_fpp0", 100 | "nameOnDisk" : "measure_fpp0", 101 | "paths" : 102 | { 103 | "build" : ".", 104 | "source" : "." 105 | }, 106 | "sourceGroups" : 107 | [ 108 | { 109 | "name" : "Header Files", 110 | "sourceIndexes" : 111 | [ 112 | 0, 113 | 1, 114 | 2, 115 | 3, 116 | 4, 117 | 5, 118 | 6, 119 | 8, 120 | 10, 121 | 12, 122 | 13, 123 | 15, 124 | 16, 125 | 17, 126 | 18, 127 | 19, 128 | 20, 129 | 22 130 | ] 131 | }, 132 | { 133 | "name" : "Source Files", 134 | "sourceIndexes" : 135 | [ 136 | 7, 137 | 9, 138 | 11, 139 | 14, 140 | 21, 141 | 23 142 | ] 143 | } 144 | ], 145 | "sources" : 146 | [ 147 | { 148 | "backtrace" : 1, 149 | "path" : "Bloom_Filter/simd-block.h", 150 | "sourceGroupIndex" : 0 151 | }, 152 | { 153 | "backtrace" : 1, 154 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 155 | "sourceGroupIndex" : 0 156 | }, 157 | { 158 | "backtrace" : 1, 159 | "path" : "Bloom_Filter/Impala512.h", 160 | "sourceGroupIndex" : 0 161 | }, 162 | { 163 | "backtrace" : 1, 164 | "path" : "Bloom_Filter/bloom.hpp", 165 | "sourceGroupIndex" : 0 166 | }, 167 | { 168 | "backtrace" : 1, 169 | "path" : "hashutil.h", 170 | "sourceGroupIndex" : 0 171 | }, 172 | { 173 | "backtrace" : 1, 174 | "path" : "Tests/wrappers.hpp", 175 | "sourceGroupIndex" : 0 176 | }, 177 | { 178 | "backtrace" : 1, 179 | "path" : "Tests/smart_tests.hpp", 180 | "sourceGroupIndex" : 0 181 | }, 182 | { 183 | "backtrace" : 1, 184 | "compileGroupIndex" : 0, 185 | "path" : "Tests/smart_tests.cpp", 186 | "sourceGroupIndex" : 1 187 | }, 188 | { 189 | "backtrace" : 1, 190 | "path" : "Prefix-Filter/Shift_op.hpp", 191 | "sourceGroupIndex" : 0 192 | }, 193 | { 194 | "backtrace" : 1, 195 | "compileGroupIndex" : 0, 196 | "path" : "Prefix-Filter/Shift_op.cpp", 197 | "sourceGroupIndex" : 1 198 | }, 199 | { 200 | "backtrace" : 1, 201 | "path" : "Prefix-Filter/min_pd256.hpp", 202 | "sourceGroupIndex" : 0 203 | }, 204 | { 205 | "backtrace" : 1, 206 | "compileGroupIndex" : 0, 207 | "path" : "Prefix-Filter/min_pd256.cpp", 208 | "sourceGroupIndex" : 1 209 | }, 210 | { 211 | "backtrace" : 1, 212 | "path" : "cuckoofilter/src/bitsutil.h", 213 | "sourceGroupIndex" : 0 214 | }, 215 | { 216 | "backtrace" : 1, 217 | "path" : "cuckoofilter/src/permencoding.h", 218 | "sourceGroupIndex" : 0 219 | }, 220 | { 221 | "backtrace" : 1, 222 | "compileGroupIndex" : 0, 223 | "path" : "cuckoofilter/src/printutil.cc", 224 | "sourceGroupIndex" : 1 225 | }, 226 | { 227 | "backtrace" : 1, 228 | "path" : "cuckoofilter/src/debug.h", 229 | "sourceGroupIndex" : 0 230 | }, 231 | { 232 | "backtrace" : 1, 233 | "path" : "cuckoofilter/src/singletable.h", 234 | "sourceGroupIndex" : 0 235 | }, 236 | { 237 | "backtrace" : 1, 238 | "path" : "cuckoofilter/src/packedtable.h", 239 | "sourceGroupIndex" : 0 240 | }, 241 | { 242 | "backtrace" : 1, 243 | "path" : "cuckoofilter/src/cuckoofilter.h", 244 | "sourceGroupIndex" : 0 245 | }, 246 | { 247 | "backtrace" : 1, 248 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 249 | "sourceGroupIndex" : 0 250 | }, 251 | { 252 | "backtrace" : 1, 253 | "path" : "TC-Shortcut/tc-sym.hpp", 254 | "sourceGroupIndex" : 0 255 | }, 256 | { 257 | "backtrace" : 1, 258 | "compileGroupIndex" : 0, 259 | "path" : "TC-Shortcut/tc-sym.cpp", 260 | "sourceGroupIndex" : 1 261 | }, 262 | { 263 | "backtrace" : 1, 264 | "path" : "TC-Shortcut/TC-shortcut.hpp", 265 | "sourceGroupIndex" : 0 266 | }, 267 | { 268 | "backtrace" : 1, 269 | "compileGroupIndex" : 0, 270 | "path" : "main-fpp.cpp", 271 | "sourceGroupIndex" : 1 272 | } 273 | ], 274 | "type" : "EXECUTABLE" 275 | } 276 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-measure_fpp3-Debug-12090f7133d04d45c993.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "measure_fpp3" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 91, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 94, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-O3" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-g3" 54 | }, 55 | { 56 | "fragment" : "-std=gnu++17" 57 | } 58 | ], 59 | "language" : "CXX", 60 | "languageStandard" : 61 | { 62 | "backtraces" : 63 | [ 64 | 1 65 | ], 66 | "standard" : "17" 67 | }, 68 | "sourceIndexes" : 69 | [ 70 | 7, 71 | 9, 72 | 11, 73 | 14, 74 | 21, 75 | 23 76 | ] 77 | } 78 | ], 79 | "id" : "measure_fpp3::@6890427a1f51a3e7e1df", 80 | "link" : 81 | { 82 | "commandFragments" : 83 | [ 84 | { 85 | "fragment" : "-march=native -g", 86 | "role" : "flags" 87 | }, 88 | { 89 | "fragment" : "", 90 | "role" : "flags" 91 | } 92 | ], 93 | "language" : "CXX" 94 | }, 95 | "name" : "measure_fpp3", 96 | "nameOnDisk" : "measure_fpp3", 97 | "paths" : 98 | { 99 | "build" : ".", 100 | "source" : "." 101 | }, 102 | "sourceGroups" : 103 | [ 104 | { 105 | "name" : "Header Files", 106 | "sourceIndexes" : 107 | [ 108 | 0, 109 | 1, 110 | 2, 111 | 3, 112 | 4, 113 | 5, 114 | 6, 115 | 8, 116 | 10, 117 | 12, 118 | 13, 119 | 15, 120 | 16, 121 | 17, 122 | 18, 123 | 19, 124 | 20, 125 | 22 126 | ] 127 | }, 128 | { 129 | "name" : "Source Files", 130 | "sourceIndexes" : 131 | [ 132 | 7, 133 | 9, 134 | 11, 135 | 14, 136 | 21, 137 | 23 138 | ] 139 | } 140 | ], 141 | "sources" : 142 | [ 143 | { 144 | "backtrace" : 1, 145 | "path" : "Bloom_Filter/simd-block.h", 146 | "sourceGroupIndex" : 0 147 | }, 148 | { 149 | "backtrace" : 1, 150 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 151 | "sourceGroupIndex" : 0 152 | }, 153 | { 154 | "backtrace" : 1, 155 | "path" : "Bloom_Filter/Impala512.h", 156 | "sourceGroupIndex" : 0 157 | }, 158 | { 159 | "backtrace" : 1, 160 | "path" : "Bloom_Filter/bloom.hpp", 161 | "sourceGroupIndex" : 0 162 | }, 163 | { 164 | "backtrace" : 1, 165 | "path" : "hashutil.h", 166 | "sourceGroupIndex" : 0 167 | }, 168 | { 169 | "backtrace" : 1, 170 | "path" : "Tests/wrappers.hpp", 171 | "sourceGroupIndex" : 0 172 | }, 173 | { 174 | "backtrace" : 1, 175 | "path" : "Tests/smart_tests.hpp", 176 | "sourceGroupIndex" : 0 177 | }, 178 | { 179 | "backtrace" : 1, 180 | "compileGroupIndex" : 0, 181 | "path" : "Tests/smart_tests.cpp", 182 | "sourceGroupIndex" : 1 183 | }, 184 | { 185 | "backtrace" : 1, 186 | "path" : "Prefix-Filter/Shift_op.hpp", 187 | "sourceGroupIndex" : 0 188 | }, 189 | { 190 | "backtrace" : 1, 191 | "compileGroupIndex" : 0, 192 | "path" : "Prefix-Filter/Shift_op.cpp", 193 | "sourceGroupIndex" : 1 194 | }, 195 | { 196 | "backtrace" : 1, 197 | "path" : "Prefix-Filter/min_pd256.hpp", 198 | "sourceGroupIndex" : 0 199 | }, 200 | { 201 | "backtrace" : 1, 202 | "compileGroupIndex" : 0, 203 | "path" : "Prefix-Filter/min_pd256.cpp", 204 | "sourceGroupIndex" : 1 205 | }, 206 | { 207 | "backtrace" : 1, 208 | "path" : "cuckoofilter/src/bitsutil.h", 209 | "sourceGroupIndex" : 0 210 | }, 211 | { 212 | "backtrace" : 1, 213 | "path" : "cuckoofilter/src/permencoding.h", 214 | "sourceGroupIndex" : 0 215 | }, 216 | { 217 | "backtrace" : 1, 218 | "compileGroupIndex" : 0, 219 | "path" : "cuckoofilter/src/printutil.cc", 220 | "sourceGroupIndex" : 1 221 | }, 222 | { 223 | "backtrace" : 1, 224 | "path" : "cuckoofilter/src/debug.h", 225 | "sourceGroupIndex" : 0 226 | }, 227 | { 228 | "backtrace" : 1, 229 | "path" : "cuckoofilter/src/singletable.h", 230 | "sourceGroupIndex" : 0 231 | }, 232 | { 233 | "backtrace" : 1, 234 | "path" : "cuckoofilter/src/packedtable.h", 235 | "sourceGroupIndex" : 0 236 | }, 237 | { 238 | "backtrace" : 1, 239 | "path" : "cuckoofilter/src/cuckoofilter.h", 240 | "sourceGroupIndex" : 0 241 | }, 242 | { 243 | "backtrace" : 1, 244 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 245 | "sourceGroupIndex" : 0 246 | }, 247 | { 248 | "backtrace" : 1, 249 | "path" : "TC-Shortcut/tc-sym.hpp", 250 | "sourceGroupIndex" : 0 251 | }, 252 | { 253 | "backtrace" : 1, 254 | "compileGroupIndex" : 0, 255 | "path" : "TC-Shortcut/tc-sym.cpp", 256 | "sourceGroupIndex" : 1 257 | }, 258 | { 259 | "backtrace" : 1, 260 | "path" : "TC-Shortcut/TC-shortcut.hpp", 261 | "sourceGroupIndex" : 0 262 | }, 263 | { 264 | "backtrace" : 1, 265 | "compileGroupIndex" : 0, 266 | "path" : "main-fpp.cpp", 267 | "sourceGroupIndex" : 1 268 | } 269 | ], 270 | "type" : "EXECUTABLE" 271 | } 272 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-measure_perf-Debug-a7f31f032634834b67c5.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "measure_perf" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 102, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 105, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-Ofast" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-DNDEBUG" 54 | }, 55 | { 56 | "fragment" : "-std=gnu++17" 57 | } 58 | ], 59 | "language" : "CXX", 60 | "languageStandard" : 61 | { 62 | "backtraces" : 63 | [ 64 | 1 65 | ], 66 | "standard" : "17" 67 | }, 68 | "sourceIndexes" : 69 | [ 70 | 7, 71 | 9, 72 | 11, 73 | 14, 74 | 21, 75 | 23 76 | ] 77 | } 78 | ], 79 | "id" : "measure_perf::@6890427a1f51a3e7e1df", 80 | "link" : 81 | { 82 | "commandFragments" : 83 | [ 84 | { 85 | "fragment" : "-march=native -g", 86 | "role" : "flags" 87 | }, 88 | { 89 | "fragment" : "", 90 | "role" : "flags" 91 | } 92 | ], 93 | "language" : "CXX" 94 | }, 95 | "name" : "measure_perf", 96 | "nameOnDisk" : "measure_perf", 97 | "paths" : 98 | { 99 | "build" : ".", 100 | "source" : "." 101 | }, 102 | "sourceGroups" : 103 | [ 104 | { 105 | "name" : "Header Files", 106 | "sourceIndexes" : 107 | [ 108 | 0, 109 | 1, 110 | 2, 111 | 3, 112 | 4, 113 | 5, 114 | 6, 115 | 8, 116 | 10, 117 | 12, 118 | 13, 119 | 15, 120 | 16, 121 | 17, 122 | 18, 123 | 19, 124 | 20, 125 | 22 126 | ] 127 | }, 128 | { 129 | "name" : "Source Files", 130 | "sourceIndexes" : 131 | [ 132 | 7, 133 | 9, 134 | 11, 135 | 14, 136 | 21, 137 | 23 138 | ] 139 | } 140 | ], 141 | "sources" : 142 | [ 143 | { 144 | "backtrace" : 1, 145 | "path" : "Bloom_Filter/simd-block.h", 146 | "sourceGroupIndex" : 0 147 | }, 148 | { 149 | "backtrace" : 1, 150 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 151 | "sourceGroupIndex" : 0 152 | }, 153 | { 154 | "backtrace" : 1, 155 | "path" : "Bloom_Filter/Impala512.h", 156 | "sourceGroupIndex" : 0 157 | }, 158 | { 159 | "backtrace" : 1, 160 | "path" : "Bloom_Filter/bloom.hpp", 161 | "sourceGroupIndex" : 0 162 | }, 163 | { 164 | "backtrace" : 1, 165 | "path" : "hashutil.h", 166 | "sourceGroupIndex" : 0 167 | }, 168 | { 169 | "backtrace" : 1, 170 | "path" : "Tests/wrappers.hpp", 171 | "sourceGroupIndex" : 0 172 | }, 173 | { 174 | "backtrace" : 1, 175 | "path" : "Tests/smart_tests.hpp", 176 | "sourceGroupIndex" : 0 177 | }, 178 | { 179 | "backtrace" : 1, 180 | "compileGroupIndex" : 0, 181 | "path" : "Tests/smart_tests.cpp", 182 | "sourceGroupIndex" : 1 183 | }, 184 | { 185 | "backtrace" : 1, 186 | "path" : "Prefix-Filter/Shift_op.hpp", 187 | "sourceGroupIndex" : 0 188 | }, 189 | { 190 | "backtrace" : 1, 191 | "compileGroupIndex" : 0, 192 | "path" : "Prefix-Filter/Shift_op.cpp", 193 | "sourceGroupIndex" : 1 194 | }, 195 | { 196 | "backtrace" : 1, 197 | "path" : "Prefix-Filter/min_pd256.hpp", 198 | "sourceGroupIndex" : 0 199 | }, 200 | { 201 | "backtrace" : 1, 202 | "compileGroupIndex" : 0, 203 | "path" : "Prefix-Filter/min_pd256.cpp", 204 | "sourceGroupIndex" : 1 205 | }, 206 | { 207 | "backtrace" : 1, 208 | "path" : "cuckoofilter/src/bitsutil.h", 209 | "sourceGroupIndex" : 0 210 | }, 211 | { 212 | "backtrace" : 1, 213 | "path" : "cuckoofilter/src/permencoding.h", 214 | "sourceGroupIndex" : 0 215 | }, 216 | { 217 | "backtrace" : 1, 218 | "compileGroupIndex" : 0, 219 | "path" : "cuckoofilter/src/printutil.cc", 220 | "sourceGroupIndex" : 1 221 | }, 222 | { 223 | "backtrace" : 1, 224 | "path" : "cuckoofilter/src/debug.h", 225 | "sourceGroupIndex" : 0 226 | }, 227 | { 228 | "backtrace" : 1, 229 | "path" : "cuckoofilter/src/singletable.h", 230 | "sourceGroupIndex" : 0 231 | }, 232 | { 233 | "backtrace" : 1, 234 | "path" : "cuckoofilter/src/packedtable.h", 235 | "sourceGroupIndex" : 0 236 | }, 237 | { 238 | "backtrace" : 1, 239 | "path" : "cuckoofilter/src/cuckoofilter.h", 240 | "sourceGroupIndex" : 0 241 | }, 242 | { 243 | "backtrace" : 1, 244 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 245 | "sourceGroupIndex" : 0 246 | }, 247 | { 248 | "backtrace" : 1, 249 | "path" : "TC-Shortcut/tc-sym.hpp", 250 | "sourceGroupIndex" : 0 251 | }, 252 | { 253 | "backtrace" : 1, 254 | "compileGroupIndex" : 0, 255 | "path" : "TC-Shortcut/tc-sym.cpp", 256 | "sourceGroupIndex" : 1 257 | }, 258 | { 259 | "backtrace" : 1, 260 | "path" : "TC-Shortcut/TC-shortcut.hpp", 261 | "sourceGroupIndex" : 0 262 | }, 263 | { 264 | "backtrace" : 1, 265 | "compileGroupIndex" : 0, 266 | "path" : "main-perf.cpp", 267 | "sourceGroupIndex" : 1 268 | } 269 | ], 270 | "type" : "EXECUTABLE" 271 | } 272 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-measure_perf0-Debug-b41767523d8bde5ed7bd.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "measure_perf0" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 100, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 103, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-O0" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-g3" 54 | }, 55 | { 56 | "backtrace" : 2, 57 | "fragment" : "-W" 58 | }, 59 | { 60 | "fragment" : "-std=gnu++17" 61 | } 62 | ], 63 | "language" : "CXX", 64 | "languageStandard" : 65 | { 66 | "backtraces" : 67 | [ 68 | 1 69 | ], 70 | "standard" : "17" 71 | }, 72 | "sourceIndexes" : 73 | [ 74 | 7, 75 | 9, 76 | 11, 77 | 14, 78 | 21, 79 | 23 80 | ] 81 | } 82 | ], 83 | "id" : "measure_perf0::@6890427a1f51a3e7e1df", 84 | "link" : 85 | { 86 | "commandFragments" : 87 | [ 88 | { 89 | "fragment" : "-march=native -g", 90 | "role" : "flags" 91 | }, 92 | { 93 | "fragment" : "", 94 | "role" : "flags" 95 | } 96 | ], 97 | "language" : "CXX" 98 | }, 99 | "name" : "measure_perf0", 100 | "nameOnDisk" : "measure_perf0", 101 | "paths" : 102 | { 103 | "build" : ".", 104 | "source" : "." 105 | }, 106 | "sourceGroups" : 107 | [ 108 | { 109 | "name" : "Header Files", 110 | "sourceIndexes" : 111 | [ 112 | 0, 113 | 1, 114 | 2, 115 | 3, 116 | 4, 117 | 5, 118 | 6, 119 | 8, 120 | 10, 121 | 12, 122 | 13, 123 | 15, 124 | 16, 125 | 17, 126 | 18, 127 | 19, 128 | 20, 129 | 22 130 | ] 131 | }, 132 | { 133 | "name" : "Source Files", 134 | "sourceIndexes" : 135 | [ 136 | 7, 137 | 9, 138 | 11, 139 | 14, 140 | 21, 141 | 23 142 | ] 143 | } 144 | ], 145 | "sources" : 146 | [ 147 | { 148 | "backtrace" : 1, 149 | "path" : "Bloom_Filter/simd-block.h", 150 | "sourceGroupIndex" : 0 151 | }, 152 | { 153 | "backtrace" : 1, 154 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 155 | "sourceGroupIndex" : 0 156 | }, 157 | { 158 | "backtrace" : 1, 159 | "path" : "Bloom_Filter/Impala512.h", 160 | "sourceGroupIndex" : 0 161 | }, 162 | { 163 | "backtrace" : 1, 164 | "path" : "Bloom_Filter/bloom.hpp", 165 | "sourceGroupIndex" : 0 166 | }, 167 | { 168 | "backtrace" : 1, 169 | "path" : "hashutil.h", 170 | "sourceGroupIndex" : 0 171 | }, 172 | { 173 | "backtrace" : 1, 174 | "path" : "Tests/wrappers.hpp", 175 | "sourceGroupIndex" : 0 176 | }, 177 | { 178 | "backtrace" : 1, 179 | "path" : "Tests/smart_tests.hpp", 180 | "sourceGroupIndex" : 0 181 | }, 182 | { 183 | "backtrace" : 1, 184 | "compileGroupIndex" : 0, 185 | "path" : "Tests/smart_tests.cpp", 186 | "sourceGroupIndex" : 1 187 | }, 188 | { 189 | "backtrace" : 1, 190 | "path" : "Prefix-Filter/Shift_op.hpp", 191 | "sourceGroupIndex" : 0 192 | }, 193 | { 194 | "backtrace" : 1, 195 | "compileGroupIndex" : 0, 196 | "path" : "Prefix-Filter/Shift_op.cpp", 197 | "sourceGroupIndex" : 1 198 | }, 199 | { 200 | "backtrace" : 1, 201 | "path" : "Prefix-Filter/min_pd256.hpp", 202 | "sourceGroupIndex" : 0 203 | }, 204 | { 205 | "backtrace" : 1, 206 | "compileGroupIndex" : 0, 207 | "path" : "Prefix-Filter/min_pd256.cpp", 208 | "sourceGroupIndex" : 1 209 | }, 210 | { 211 | "backtrace" : 1, 212 | "path" : "cuckoofilter/src/bitsutil.h", 213 | "sourceGroupIndex" : 0 214 | }, 215 | { 216 | "backtrace" : 1, 217 | "path" : "cuckoofilter/src/permencoding.h", 218 | "sourceGroupIndex" : 0 219 | }, 220 | { 221 | "backtrace" : 1, 222 | "compileGroupIndex" : 0, 223 | "path" : "cuckoofilter/src/printutil.cc", 224 | "sourceGroupIndex" : 1 225 | }, 226 | { 227 | "backtrace" : 1, 228 | "path" : "cuckoofilter/src/debug.h", 229 | "sourceGroupIndex" : 0 230 | }, 231 | { 232 | "backtrace" : 1, 233 | "path" : "cuckoofilter/src/singletable.h", 234 | "sourceGroupIndex" : 0 235 | }, 236 | { 237 | "backtrace" : 1, 238 | "path" : "cuckoofilter/src/packedtable.h", 239 | "sourceGroupIndex" : 0 240 | }, 241 | { 242 | "backtrace" : 1, 243 | "path" : "cuckoofilter/src/cuckoofilter.h", 244 | "sourceGroupIndex" : 0 245 | }, 246 | { 247 | "backtrace" : 1, 248 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 249 | "sourceGroupIndex" : 0 250 | }, 251 | { 252 | "backtrace" : 1, 253 | "path" : "TC-Shortcut/tc-sym.hpp", 254 | "sourceGroupIndex" : 0 255 | }, 256 | { 257 | "backtrace" : 1, 258 | "compileGroupIndex" : 0, 259 | "path" : "TC-Shortcut/tc-sym.cpp", 260 | "sourceGroupIndex" : 1 261 | }, 262 | { 263 | "backtrace" : 1, 264 | "path" : "TC-Shortcut/TC-shortcut.hpp", 265 | "sourceGroupIndex" : 0 266 | }, 267 | { 268 | "backtrace" : 1, 269 | "compileGroupIndex" : 0, 270 | "path" : "main-perf.cpp", 271 | "sourceGroupIndex" : 1 272 | } 273 | ], 274 | "type" : "EXECUTABLE" 275 | } 276 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/target-measure_perf3-Debug-1815e855f242cbd76a5a.json: -------------------------------------------------------------------------------- 1 | { 2 | "artifacts" : 3 | [ 4 | { 5 | "path" : "measure_perf3" 6 | } 7 | ], 8 | "backtrace" : 1, 9 | "backtraceGraph" : 10 | { 11 | "commands" : 12 | [ 13 | "add_executable", 14 | "target_compile_options" 15 | ], 16 | "files" : 17 | [ 18 | "CMakeLists.txt" 19 | ], 20 | "nodes" : 21 | [ 22 | { 23 | "file" : 0 24 | }, 25 | { 26 | "command" : 0, 27 | "file" : 0, 28 | "line" : 101, 29 | "parent" : 0 30 | }, 31 | { 32 | "command" : 1, 33 | "file" : 0, 34 | "line" : 104, 35 | "parent" : 0 36 | } 37 | ] 38 | }, 39 | "compileGroups" : 40 | [ 41 | { 42 | "compileCommandFragments" : 43 | [ 44 | { 45 | "fragment" : "-march=native -g" 46 | }, 47 | { 48 | "backtrace" : 2, 49 | "fragment" : "-O3" 50 | }, 51 | { 52 | "backtrace" : 2, 53 | "fragment" : "-g3" 54 | }, 55 | { 56 | "fragment" : "-std=gnu++17" 57 | } 58 | ], 59 | "language" : "CXX", 60 | "languageStandard" : 61 | { 62 | "backtraces" : 63 | [ 64 | 1 65 | ], 66 | "standard" : "17" 67 | }, 68 | "sourceIndexes" : 69 | [ 70 | 7, 71 | 9, 72 | 11, 73 | 14, 74 | 21, 75 | 23 76 | ] 77 | } 78 | ], 79 | "id" : "measure_perf3::@6890427a1f51a3e7e1df", 80 | "link" : 81 | { 82 | "commandFragments" : 83 | [ 84 | { 85 | "fragment" : "-march=native -g", 86 | "role" : "flags" 87 | }, 88 | { 89 | "fragment" : "", 90 | "role" : "flags" 91 | } 92 | ], 93 | "language" : "CXX" 94 | }, 95 | "name" : "measure_perf3", 96 | "nameOnDisk" : "measure_perf3", 97 | "paths" : 98 | { 99 | "build" : ".", 100 | "source" : "." 101 | }, 102 | "sourceGroups" : 103 | [ 104 | { 105 | "name" : "Header Files", 106 | "sourceIndexes" : 107 | [ 108 | 0, 109 | 1, 110 | 2, 111 | 3, 112 | 4, 113 | 5, 114 | 6, 115 | 8, 116 | 10, 117 | 12, 118 | 13, 119 | 15, 120 | 16, 121 | 17, 122 | 18, 123 | 19, 124 | 20, 125 | 22 126 | ] 127 | }, 128 | { 129 | "name" : "Source Files", 130 | "sourceIndexes" : 131 | [ 132 | 7, 133 | 9, 134 | 11, 135 | 14, 136 | 21, 137 | 23 138 | ] 139 | } 140 | ], 141 | "sources" : 142 | [ 143 | { 144 | "backtrace" : 1, 145 | "path" : "Bloom_Filter/simd-block.h", 146 | "sourceGroupIndex" : 0 147 | }, 148 | { 149 | "backtrace" : 1, 150 | "path" : "Bloom_Filter/simd-block-fixed-fpp.h", 151 | "sourceGroupIndex" : 0 152 | }, 153 | { 154 | "backtrace" : 1, 155 | "path" : "Bloom_Filter/Impala512.h", 156 | "sourceGroupIndex" : 0 157 | }, 158 | { 159 | "backtrace" : 1, 160 | "path" : "Bloom_Filter/bloom.hpp", 161 | "sourceGroupIndex" : 0 162 | }, 163 | { 164 | "backtrace" : 1, 165 | "path" : "hashutil.h", 166 | "sourceGroupIndex" : 0 167 | }, 168 | { 169 | "backtrace" : 1, 170 | "path" : "Tests/wrappers.hpp", 171 | "sourceGroupIndex" : 0 172 | }, 173 | { 174 | "backtrace" : 1, 175 | "path" : "Tests/smart_tests.hpp", 176 | "sourceGroupIndex" : 0 177 | }, 178 | { 179 | "backtrace" : 1, 180 | "compileGroupIndex" : 0, 181 | "path" : "Tests/smart_tests.cpp", 182 | "sourceGroupIndex" : 1 183 | }, 184 | { 185 | "backtrace" : 1, 186 | "path" : "Prefix-Filter/Shift_op.hpp", 187 | "sourceGroupIndex" : 0 188 | }, 189 | { 190 | "backtrace" : 1, 191 | "compileGroupIndex" : 0, 192 | "path" : "Prefix-Filter/Shift_op.cpp", 193 | "sourceGroupIndex" : 1 194 | }, 195 | { 196 | "backtrace" : 1, 197 | "path" : "Prefix-Filter/min_pd256.hpp", 198 | "sourceGroupIndex" : 0 199 | }, 200 | { 201 | "backtrace" : 1, 202 | "compileGroupIndex" : 0, 203 | "path" : "Prefix-Filter/min_pd256.cpp", 204 | "sourceGroupIndex" : 1 205 | }, 206 | { 207 | "backtrace" : 1, 208 | "path" : "cuckoofilter/src/bitsutil.h", 209 | "sourceGroupIndex" : 0 210 | }, 211 | { 212 | "backtrace" : 1, 213 | "path" : "cuckoofilter/src/permencoding.h", 214 | "sourceGroupIndex" : 0 215 | }, 216 | { 217 | "backtrace" : 1, 218 | "compileGroupIndex" : 0, 219 | "path" : "cuckoofilter/src/printutil.cc", 220 | "sourceGroupIndex" : 1 221 | }, 222 | { 223 | "backtrace" : 1, 224 | "path" : "cuckoofilter/src/debug.h", 225 | "sourceGroupIndex" : 0 226 | }, 227 | { 228 | "backtrace" : 1, 229 | "path" : "cuckoofilter/src/singletable.h", 230 | "sourceGroupIndex" : 0 231 | }, 232 | { 233 | "backtrace" : 1, 234 | "path" : "cuckoofilter/src/packedtable.h", 235 | "sourceGroupIndex" : 0 236 | }, 237 | { 238 | "backtrace" : 1, 239 | "path" : "cuckoofilter/src/cuckoofilter.h", 240 | "sourceGroupIndex" : 0 241 | }, 242 | { 243 | "backtrace" : 1, 244 | "path" : "cuckoofilter/src/cuckoofilter_stable.h", 245 | "sourceGroupIndex" : 0 246 | }, 247 | { 248 | "backtrace" : 1, 249 | "path" : "TC-Shortcut/tc-sym.hpp", 250 | "sourceGroupIndex" : 0 251 | }, 252 | { 253 | "backtrace" : 1, 254 | "compileGroupIndex" : 0, 255 | "path" : "TC-Shortcut/tc-sym.cpp", 256 | "sourceGroupIndex" : 1 257 | }, 258 | { 259 | "backtrace" : 1, 260 | "path" : "TC-Shortcut/TC-shortcut.hpp", 261 | "sourceGroupIndex" : 0 262 | }, 263 | { 264 | "backtrace" : 1, 265 | "compileGroupIndex" : 0, 266 | "path" : "main-perf.cpp", 267 | "sourceGroupIndex" : 1 268 | } 269 | ], 270 | "type" : "EXECUTABLE" 271 | } 272 | -------------------------------------------------------------------------------- /cmake-build-debug/.cmake/api/v1/reply/toolchains-v1-b0b7064a037a803f7bb5.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind" : "toolchains", 3 | "toolchains" : 4 | [ 5 | { 6 | "compiler" : 7 | { 8 | "id" : "GNU", 9 | "implicit" : 10 | { 11 | "includeDirectories" : 12 | [ 13 | "/usr/lib/gcc/x86_64-linux-gnu/10/include", 14 | "/usr/local/include", 15 | "/usr/include/x86_64-linux-gnu", 16 | "/usr/include" 17 | ], 18 | "linkDirectories" : 19 | [ 20 | "/usr/lib/gcc/x86_64-linux-gnu/10", 21 | "/usr/lib/x86_64-linux-gnu", 22 | "/usr/lib", 23 | "/lib/x86_64-linux-gnu", 24 | "/lib" 25 | ], 26 | "linkFrameworkDirectories" : [], 27 | "linkLibraries" : 28 | [ 29 | "gcc", 30 | "gcc_s", 31 | "c", 32 | "gcc", 33 | "gcc_s" 34 | ] 35 | }, 36 | "path" : "/usr/bin/gcc-10", 37 | "version" : "10.3.0" 38 | }, 39 | "language" : "C", 40 | "sourceFileExtensions" : 41 | [ 42 | "c", 43 | "m" 44 | ] 45 | }, 46 | { 47 | "compiler" : 48 | { 49 | "id" : "GNU", 50 | "implicit" : 51 | { 52 | "includeDirectories" : 53 | [ 54 | "/usr/include/c++/10", 55 | "/usr/include/x86_64-linux-gnu/c++/10", 56 | "/usr/include/c++/10/backward", 57 | "/usr/lib/gcc/x86_64-linux-gnu/10/include", 58 | "/usr/local/include", 59 | "/usr/include/x86_64-linux-gnu", 60 | "/usr/include" 61 | ], 62 | "linkDirectories" : 63 | [ 64 | "/usr/lib/gcc/x86_64-linux-gnu/10", 65 | "/usr/lib/x86_64-linux-gnu", 66 | "/usr/lib", 67 | "/lib/x86_64-linux-gnu", 68 | "/lib" 69 | ], 70 | "linkFrameworkDirectories" : [], 71 | "linkLibraries" : 72 | [ 73 | "stdc++", 74 | "m", 75 | "gcc_s", 76 | "gcc", 77 | "c", 78 | "gcc_s", 79 | "gcc" 80 | ] 81 | }, 82 | "path" : "/usr/bin/g++-10", 83 | "version" : "10.3.0" 84 | }, 85 | "language" : "CXX", 86 | "sourceFileExtensions" : 87 | [ 88 | "C", 89 | "M", 90 | "c++", 91 | "cc", 92 | "cpp", 93 | "cxx", 94 | "mm", 95 | "mpp", 96 | "CPP", 97 | "ixx", 98 | "cppm" 99 | ] 100 | } 101 | ], 102 | "version" : 103 | { 104 | "major" : 1, 105 | "minor" : 0 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.21.1/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/usr/bin/gcc-10") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "10.3.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | set(CMAKE_C17_COMPILE_FEATURES "c_std_17") 13 | set(CMAKE_C23_COMPILE_FEATURES "c_std_23") 14 | 15 | set(CMAKE_C_PLATFORM_ID "Linux") 16 | set(CMAKE_C_SIMULATE_ID "") 17 | set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") 18 | set(CMAKE_C_SIMULATE_VERSION "") 19 | 20 | 21 | 22 | 23 | set(CMAKE_AR "/usr/bin/ar") 24 | set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-10") 25 | set(CMAKE_RANLIB "/usr/bin/ranlib") 26 | set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-10") 27 | set(CMAKE_LINKER "/usr/bin/ld") 28 | set(CMAKE_MT "") 29 | set(CMAKE_COMPILER_IS_GNUCC 1) 30 | set(CMAKE_C_COMPILER_LOADED 1) 31 | set(CMAKE_C_COMPILER_WORKS TRUE) 32 | set(CMAKE_C_ABI_COMPILED TRUE) 33 | set(CMAKE_COMPILER_IS_MINGW ) 34 | set(CMAKE_COMPILER_IS_CYGWIN ) 35 | if(CMAKE_COMPILER_IS_CYGWIN) 36 | set(CYGWIN 1) 37 | set(UNIX 1) 38 | endif() 39 | 40 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 41 | 42 | if(CMAKE_COMPILER_IS_MINGW) 43 | set(MINGW 1) 44 | endif() 45 | set(CMAKE_C_COMPILER_ID_RUN 1) 46 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 47 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 48 | set(CMAKE_C_LINKER_PREFERENCE 10) 49 | 50 | # Save compiler ABI information. 51 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 52 | set(CMAKE_C_COMPILER_ABI "ELF") 53 | set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") 54 | set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 55 | 56 | if(CMAKE_C_SIZEOF_DATA_PTR) 57 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 58 | endif() 59 | 60 | if(CMAKE_C_COMPILER_ABI) 61 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 62 | endif() 63 | 64 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 65 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 66 | endif() 67 | 68 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 69 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 70 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 71 | endif() 72 | 73 | 74 | 75 | 76 | 77 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/10/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") 78 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s") 79 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/10;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 80 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 81 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.21.1/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/usr/bin/g++-10") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "10.3.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 14 | set(CMAKE_CXX23_COMPILE_FEATURES "") 15 | 16 | set(CMAKE_CXX_PLATFORM_ID "Linux") 17 | set(CMAKE_CXX_SIMULATE_ID "") 18 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") 19 | set(CMAKE_CXX_SIMULATE_VERSION "") 20 | 21 | 22 | 23 | 24 | set(CMAKE_AR "/usr/bin/ar") 25 | set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-10") 26 | set(CMAKE_RANLIB "/usr/bin/ranlib") 27 | set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-10") 28 | set(CMAKE_LINKER "/usr/bin/ld") 29 | set(CMAKE_MT "") 30 | set(CMAKE_COMPILER_IS_GNUCXX 1) 31 | set(CMAKE_CXX_COMPILER_LOADED 1) 32 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 33 | set(CMAKE_CXX_ABI_COMPILED TRUE) 34 | set(CMAKE_COMPILER_IS_MINGW ) 35 | set(CMAKE_COMPILER_IS_CYGWIN ) 36 | if(CMAKE_COMPILER_IS_CYGWIN) 37 | set(CYGWIN 1) 38 | set(UNIX 1) 39 | endif() 40 | 41 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 42 | 43 | if(CMAKE_COMPILER_IS_MINGW) 44 | set(MINGW 1) 45 | endif() 46 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 47 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm) 48 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 49 | 50 | foreach (lang C OBJC OBJCXX) 51 | if (CMAKE_${lang}_COMPILER_ID_RUN) 52 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 53 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 54 | endforeach() 55 | endif() 56 | endforeach() 57 | 58 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 59 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 60 | 61 | # Save compiler ABI information. 62 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 63 | set(CMAKE_CXX_COMPILER_ABI "ELF") 64 | set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") 65 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 66 | 67 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 68 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 69 | endif() 70 | 71 | if(CMAKE_CXX_COMPILER_ABI) 72 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 73 | endif() 74 | 75 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 76 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 77 | endif() 78 | 79 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 80 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 81 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 82 | endif() 83 | 84 | 85 | 86 | 87 | 88 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/10;/usr/include/x86_64-linux-gnu/c++/10;/usr/include/c++/10/backward;/usr/lib/gcc/x86_64-linux-gnu/10/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") 89 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") 90 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/10;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 91 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 92 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.21.1/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomerEven/Prefix-Filter/f6efa59bd84365f301014c6eb40161cb21054b69/cmake-build-debug/CMakeFiles/3.21.1/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.21.1/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomerEven/Prefix-Filter/f6efa59bd84365f301014c6eb40161cb21054b69/cmake-build-debug/CMakeFiles/3.21.1/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.21.1/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Linux-5.14.0-1027-oem") 2 | set(CMAKE_HOST_SYSTEM_NAME "Linux") 3 | set(CMAKE_HOST_SYSTEM_VERSION "5.14.0-1027-oem") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Linux-5.14.0-1027-oem") 9 | set(CMAKE_SYSTEM_NAME "Linux") 10 | set(CMAKE_SYSTEM_VERSION "5.14.0-1027-oem") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.21.1/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomerEven/Prefix-Filter/f6efa59bd84365f301014c6eb40161cb21054b69/cmake-build-debug/CMakeFiles/3.21.1/CompilerIdC/a.out -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/3.21.1/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomerEven/Prefix-Filter/f6efa59bd84365f301014c6eb40161cb21054b69/cmake-build-debug/CMakeFiles/3.21.1/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/rebuild_cache.dir 2 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/edit_cache.dir 3 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/example.dir 4 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/measure_fpp0.dir 5 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/measure_perf.dir 6 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/measure_built3.dir 7 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/measure_built0.dir 8 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/measure_built.dir 9 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/measure_perf3.dir 10 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/measure_fpp3.dir 11 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/measure_perf0.dir 12 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/measure_fpp.dir 13 | /home/tomer/Github/Public-PF/cmake-build-debug/CMakeFiles/example0.dir 14 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/clion-environment.txt: -------------------------------------------------------------------------------- 1 | ToolSet: 1.0 (local)Options: 2 | 3 | Options:-DCMAKE_MAKE_PROGRAM=/snap/clion/184/bin/ninja/linux/ninja-DCMAKE_C_COMPILER=/usr/bin/gcc-10-DCMAKE_CXX_COMPILER=/usr/bin/g++-10 -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/clion-log.txt: -------------------------------------------------------------------------------- 1 | /snap/clion/184/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/snap/clion/184/bin/ninja/linux/ninja -DCMAKE_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 -G Ninja /home/tomer/Github/Public-PF 2 | -- The C compiler identification is GNU 10.3.0 3 | -- The CXX compiler identification is GNU 10.3.0 4 | -- Detecting C compiler ABI info 5 | -- Detecting C compiler ABI info - done 6 | -- Check for working C compiler: /usr/bin/gcc-10 - skipped 7 | -- Detecting C compile features 8 | -- Detecting C compile features - done 9 | -- Detecting CXX compiler ABI info 10 | -- Detecting CXX compiler ABI info - done 11 | -- Check for working CXX compiler: /usr/bin/g++-10 - skipped 12 | -- Detecting CXX compile features 13 | -- Detecting CXX compile features - done 14 | -- Configuring done 15 | -- Generating done 16 | -- Build files have been written to: /home/tomer/Github/Public-PF/cmake-build-debug 17 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /cmake-build-debug/CMakeFiles/rules.ninja: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Ninja" Generator, CMake Version 3.21 3 | 4 | # This file contains all the rules used to get the outputs files 5 | # built from the input files. 6 | # It is included in the main 'build.ninja'. 7 | 8 | # ============================================================================= 9 | # Project: APD_ONLY 10 | # Configurations: Debug 11 | # ============================================================================= 12 | # ============================================================================= 13 | 14 | ############################################# 15 | # Rule for running custom commands. 16 | 17 | rule CUSTOM_COMMAND 18 | command = $COMMAND 19 | description = $DESC 20 | 21 | 22 | ############################################# 23 | # Rule for compiling CXX files. 24 | 25 | rule CXX_COMPILER__example_Debug 26 | depfile = $DEP_FILE 27 | deps = gcc 28 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 29 | description = Building CXX object $out 30 | 31 | 32 | ############################################# 33 | # Rule for linking CXX executable. 34 | 35 | rule CXX_EXECUTABLE_LINKER__example_Debug 36 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 37 | description = Linking CXX executable $TARGET_FILE 38 | restat = $RESTAT 39 | 40 | 41 | ############################################# 42 | # Rule for compiling CXX files. 43 | 44 | rule CXX_COMPILER__measure_fpp0_Debug 45 | depfile = $DEP_FILE 46 | deps = gcc 47 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 48 | description = Building CXX object $out 49 | 50 | 51 | ############################################# 52 | # Rule for linking CXX executable. 53 | 54 | rule CXX_EXECUTABLE_LINKER__measure_fpp0_Debug 55 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 56 | description = Linking CXX executable $TARGET_FILE 57 | restat = $RESTAT 58 | 59 | 60 | ############################################# 61 | # Rule for compiling CXX files. 62 | 63 | rule CXX_COMPILER__measure_perf_Debug 64 | depfile = $DEP_FILE 65 | deps = gcc 66 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 67 | description = Building CXX object $out 68 | 69 | 70 | ############################################# 71 | # Rule for linking CXX executable. 72 | 73 | rule CXX_EXECUTABLE_LINKER__measure_perf_Debug 74 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 75 | description = Linking CXX executable $TARGET_FILE 76 | restat = $RESTAT 77 | 78 | 79 | ############################################# 80 | # Rule for compiling CXX files. 81 | 82 | rule CXX_COMPILER__measure_built3_Debug 83 | depfile = $DEP_FILE 84 | deps = gcc 85 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 86 | description = Building CXX object $out 87 | 88 | 89 | ############################################# 90 | # Rule for linking CXX executable. 91 | 92 | rule CXX_EXECUTABLE_LINKER__measure_built3_Debug 93 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 94 | description = Linking CXX executable $TARGET_FILE 95 | restat = $RESTAT 96 | 97 | 98 | ############################################# 99 | # Rule for compiling CXX files. 100 | 101 | rule CXX_COMPILER__measure_built0_Debug 102 | depfile = $DEP_FILE 103 | deps = gcc 104 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 105 | description = Building CXX object $out 106 | 107 | 108 | ############################################# 109 | # Rule for linking CXX executable. 110 | 111 | rule CXX_EXECUTABLE_LINKER__measure_built0_Debug 112 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 113 | description = Linking CXX executable $TARGET_FILE 114 | restat = $RESTAT 115 | 116 | 117 | ############################################# 118 | # Rule for compiling CXX files. 119 | 120 | rule CXX_COMPILER__measure_built_Debug 121 | depfile = $DEP_FILE 122 | deps = gcc 123 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 124 | description = Building CXX object $out 125 | 126 | 127 | ############################################# 128 | # Rule for linking CXX executable. 129 | 130 | rule CXX_EXECUTABLE_LINKER__measure_built_Debug 131 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 132 | description = Linking CXX executable $TARGET_FILE 133 | restat = $RESTAT 134 | 135 | 136 | ############################################# 137 | # Rule for compiling CXX files. 138 | 139 | rule CXX_COMPILER__measure_perf3_Debug 140 | depfile = $DEP_FILE 141 | deps = gcc 142 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 143 | description = Building CXX object $out 144 | 145 | 146 | ############################################# 147 | # Rule for linking CXX executable. 148 | 149 | rule CXX_EXECUTABLE_LINKER__measure_perf3_Debug 150 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 151 | description = Linking CXX executable $TARGET_FILE 152 | restat = $RESTAT 153 | 154 | 155 | ############################################# 156 | # Rule for compiling CXX files. 157 | 158 | rule CXX_COMPILER__measure_fpp3_Debug 159 | depfile = $DEP_FILE 160 | deps = gcc 161 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 162 | description = Building CXX object $out 163 | 164 | 165 | ############################################# 166 | # Rule for linking CXX executable. 167 | 168 | rule CXX_EXECUTABLE_LINKER__measure_fpp3_Debug 169 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 170 | description = Linking CXX executable $TARGET_FILE 171 | restat = $RESTAT 172 | 173 | 174 | ############################################# 175 | # Rule for compiling CXX files. 176 | 177 | rule CXX_COMPILER__measure_perf0_Debug 178 | depfile = $DEP_FILE 179 | deps = gcc 180 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 181 | description = Building CXX object $out 182 | 183 | 184 | ############################################# 185 | # Rule for linking CXX executable. 186 | 187 | rule CXX_EXECUTABLE_LINKER__measure_perf0_Debug 188 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 189 | description = Linking CXX executable $TARGET_FILE 190 | restat = $RESTAT 191 | 192 | 193 | ############################################# 194 | # Rule for compiling CXX files. 195 | 196 | rule CXX_COMPILER__measure_fpp_Debug 197 | depfile = $DEP_FILE 198 | deps = gcc 199 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 200 | description = Building CXX object $out 201 | 202 | 203 | ############################################# 204 | # Rule for linking CXX executable. 205 | 206 | rule CXX_EXECUTABLE_LINKER__measure_fpp_Debug 207 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 208 | description = Linking CXX executable $TARGET_FILE 209 | restat = $RESTAT 210 | 211 | 212 | ############################################# 213 | # Rule for compiling CXX files. 214 | 215 | rule CXX_COMPILER__example0_Debug 216 | depfile = $DEP_FILE 217 | deps = gcc 218 | command = /usr/bin/g++-10 $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in 219 | description = Building CXX object $out 220 | 221 | 222 | ############################################# 223 | # Rule for linking CXX executable. 224 | 225 | rule CXX_EXECUTABLE_LINKER__example0_Debug 226 | command = $PRE_LINK && /usr/bin/g++-10 $FLAGS $LINK_FLAGS $in -o $TARGET_FILE $LINK_PATH $LINK_LIBRARIES && $POST_BUILD 227 | description = Linking CXX executable $TARGET_FILE 228 | restat = $RESTAT 229 | 230 | 231 | ############################################# 232 | # Rule for re-running cmake. 233 | 234 | rule RERUN_CMAKE 235 | command = /snap/clion/184/bin/cmake/linux/bin/cmake --regenerate-during-build -S/home/tomer/Github/Public-PF -B/home/tomer/Github/Public-PF/cmake-build-debug 236 | description = Re-running CMake... 237 | generator = 1 238 | 239 | 240 | ############################################# 241 | # Rule for cleaning all built files. 242 | 243 | rule CLEAN 244 | command = /snap/clion/184/bin/ninja/linux/ninja $FILE_ARG -t clean $TARGETS 245 | description = Cleaning all built files... 246 | 247 | 248 | ############################################# 249 | # Rule for printing all primary targets available. 250 | 251 | rule HELP 252 | command = /snap/clion/184/bin/ninja/linux/ninja -t targets 253 | description = All primary targets available: 254 | 255 | -------------------------------------------------------------------------------- /cmake-build-debug/Testing/Temporary/LastTest.log: -------------------------------------------------------------------------------- 1 | Start testing: Mar 18 12:15 IST 2 | ---------------------------------------------------------- 3 | End testing: Mar 18 12:15 IST 4 | -------------------------------------------------------------------------------- /cmake-build-debug/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/tomer/Github/Public-PF 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "FALSE") 38 | endif() 39 | 40 | # Set default install directory permissions. 41 | if(NOT DEFINED CMAKE_OBJDUMP) 42 | set(CMAKE_OBJDUMP "/usr/bin/objdump") 43 | endif() 44 | 45 | if(CMAKE_INSTALL_COMPONENT) 46 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 47 | else() 48 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 49 | endif() 50 | 51 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 52 | "${CMAKE_INSTALL_MANIFEST_FILES}") 53 | file(WRITE "/home/tomer/Github/Public-PF/cmake-build-debug/${CMAKE_INSTALL_MANIFEST}" 54 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 55 | -------------------------------------------------------------------------------- /cuckoofilter/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | # BasedOnStyle: Google 4 | AccessModifierOffset: -1 5 | AlignAfterOpenBracket: Align 6 | AlignConsecutiveAssignments: false 7 | AlignConsecutiveDeclarations: false 8 | AlignEscapedNewlinesLeft: true 9 | AlignOperands: true 10 | AlignTrailingComments: true 11 | AllowAllParametersOfDeclarationOnNextLine: true 12 | AllowShortBlocksOnASingleLine: false 13 | AllowShortCaseLabelsOnASingleLine: false 14 | AllowShortFunctionsOnASingleLine: All 15 | AllowShortIfStatementsOnASingleLine: true 16 | AllowShortLoopsOnASingleLine: true 17 | AlwaysBreakAfterDefinitionReturnType: None 18 | AlwaysBreakAfterReturnType: None 19 | AlwaysBreakBeforeMultilineStrings: true 20 | AlwaysBreakTemplateDeclarations: true 21 | BinPackArguments: true 22 | BinPackParameters: true 23 | BraceWrapping: 24 | AfterClass: false 25 | AfterControlStatement: false 26 | AfterEnum: false 27 | AfterFunction: false 28 | AfterNamespace: false 29 | AfterObjCDeclaration: false 30 | AfterStruct: false 31 | AfterUnion: false 32 | BeforeCatch: false 33 | BeforeElse: false 34 | IndentBraces: false 35 | BreakBeforeBinaryOperators: None 36 | BreakBeforeBraces: Attach 37 | BreakBeforeTernaryOperators: true 38 | BreakConstructorInitializersBeforeComma: false 39 | BreakAfterJavaFieldAnnotations: false 40 | BreakStringLiterals: true 41 | ColumnLimit: 80 42 | CommentPragmas: '^ IWYU pragma:' 43 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 44 | ConstructorInitializerIndentWidth: 4 45 | ContinuationIndentWidth: 4 46 | Cpp11BracedListStyle: true 47 | DerivePointerAlignment: false 48 | DisableFormat: false 49 | ExperimentalAutoDetectBinPacking: false 50 | ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] 51 | IncludeCategories: 52 | - Regex: '^<.*\.h>' 53 | Priority: 1 54 | - Regex: '^<.*' 55 | Priority: 2 56 | - Regex: '.*' 57 | Priority: 3 58 | IncludeIsMainRegex: '([-_](test|unittest))?$' 59 | IndentCaseLabels: true 60 | IndentWidth: 2 61 | IndentWrappedFunctionNames: false 62 | JavaScriptQuotes: Leave 63 | JavaScriptWrapImports: true 64 | KeepEmptyLinesAtTheStartOfBlocks: false 65 | MacroBlockBegin: '' 66 | MacroBlockEnd: '' 67 | MaxEmptyLinesToKeep: 1 68 | NamespaceIndentation: None 69 | ObjCBlockIndentWidth: 2 70 | ObjCSpaceAfterProperty: false 71 | ObjCSpaceBeforeProtocolList: false 72 | PenaltyBreakBeforeFirstCallParameter: 1 73 | PenaltyBreakComment: 300 74 | PenaltyBreakFirstLessLess: 120 75 | PenaltyBreakString: 1000 76 | PenaltyExcessCharacter: 1000000 77 | PenaltyReturnTypeOnItsOwnLine: 200 78 | PointerAlignment: Right 79 | ReflowComments: true 80 | SortIncludes: true 81 | SpaceAfterCStyleCast: false 82 | SpaceBeforeAssignmentOperators: true 83 | SpaceBeforeParens: ControlStatements 84 | SpaceInEmptyParentheses: false 85 | SpacesBeforeTrailingComments: 2 86 | SpacesInAngles: false 87 | SpacesInContainerLiterals: true 88 | SpacesInCStyleCastParentheses: false 89 | SpacesInParentheses: false 90 | SpacesInSquareBrackets: false 91 | Standard: Auto 92 | TabWidth: 8 93 | UseTab: Never 94 | ... 95 | 96 | -------------------------------------------------------------------------------- /cuckoofilter/.gitignore: -------------------------------------------------------------------------------- 1 | #* 2 | #*# 3 | *# 4 | *.*# 5 | *.class 6 | *.dSYM 7 | *.la 8 | *.lo 9 | *.o 10 | *.so 11 | test 12 | -------------------------------------------------------------------------------- /cuckoofilter/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013, Carnegie Mellon University and Intel Corporation 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /cuckoofilter/Makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | AR = ar 3 | PREFIX=/usr/local 4 | 5 | # Uncomment one of the following to switch between debug and opt mode 6 | #OPT = -O3 -DNDEBUG 7 | OPT = -g -ggdb 8 | 9 | CFLAGS += --std=c++11 -fno-strict-aliasing -Wall -c -I. -I./include -I/usr/include/ -I./src/ $(OPT) 10 | 11 | LDFLAGS+= -Wall -lpthread -lssl -lcrypto 12 | 13 | LIBOBJECTS = \ 14 | ./src/hashutil.o \ 15 | 16 | HEADERS = $(wildcard src/*.h) 17 | ALIB = libcuckoofilter.a 18 | 19 | TEST = test 20 | 21 | all: $(TEST) 22 | 23 | clean: 24 | rm -f $(TEST) */*.o 25 | 26 | test: example/test.o $(LIBOBJECTS) 27 | $(CC) example/test.o $(LIBOBJECTS) $(LDFLAGS) -o $@ 28 | 29 | %.o: %.cc ${HEADERS} Makefile 30 | $(CC) $(CFLAGS) $< -o $@ 31 | 32 | $(ALIB): $(LIBOBJECTS) 33 | $(AR) rcs $@ $(LIBOBJECTS) 34 | 35 | .PHONY: install 36 | install: $(ALIB) 37 | install -D -m 0755 $(HEADERS) -t $(DESTDIR)$(PREFIX)/include/cuckoofilter 38 | install -D -m 0755 $< -t $(DESTDIR)$(PREFIX)/lib 39 | 40 | .PHONY: uninstall 41 | uninstall: 42 | rm -f $(DESTDIR)$(PREFIX)/lib/$(ALIB) 43 | rm -rf $(DESTDIR)$(PREFIX)/include/cuckoofilter 44 | -------------------------------------------------------------------------------- /cuckoofilter/README.md: -------------------------------------------------------------------------------- 1 | Cuckoo Filter 2 | ============ 3 | 4 | Overview 5 | -------- 6 | Cuckoo filter is a Bloom filter replacement for approximated set-membership queries. While Bloom filters are well-known space-efficient data structures to serve queries like "if item x is in a set?", they do not support deletion. Their variances to enable deletion (like counting Bloom filters) usually require much more space. 7 | 8 | Cuckoo filters provide the flexibility to add and remove items dynamically. A cuckoo filter is based on cuckoo hashing (and therefore named as cuckoo filter). It is essentially a cuckoo hash table storing each key's fingerprint. Cuckoo hash tables can be highly compact, thus a cuckoo filter could use less space than conventional Bloom filters, for applications that require low false positive rates (< 3%). 9 | 10 | For details about the algorithm and citations please use: 11 | 12 | ["Cuckoo Filter: Practically Better Than Bloom"](http://www.cs.cmu.edu/~binfan/papers/conext14_cuckoofilter.pdf) in proceedings of ACM CoNEXT 2014 by Bin Fan, Dave Andersen and Michael Kaminsky 13 | 14 | 15 | API 16 | -------- 17 | A cuckoo filter supports following operations: 18 | 19 | * `Add(item)`: insert an item to the filter 20 | * `Contain(item)`: return if item is already in the filter. Note that this method may return false positive results like Bloom filters 21 | * `Delete(item)`: delete the given item from the filter. Note that to use this method, it must be ensured that this item is in the filter (e.g., based on records on external storage); otherwise, a false item may be deleted. 22 | * `Size()`: return the total number of items currently in the filter 23 | * `SizeInBytes()`: return the filter size in bytes 24 | 25 | Here is a simple example in C++ for the basic usage of cuckoo filter. 26 | More examples can be found in `example/` directory. 27 | 28 | ```cpp 29 | // Create a cuckoo filter where each item is of type size_t and 30 | // use 12 bits for each item, with capacity of total_items 31 | CuckooFilter filter(total_items); 32 | // Insert item 12 to this cuckoo filter 33 | filter.Add(12); 34 | // Check if previously inserted items are in the filter 35 | assert(filter.Contain(12) == cuckoofilter::Ok); 36 | ``` 37 | 38 | Repository structure 39 | -------------------- 40 | * `src/`: the C++ header and implementation of cuckoo filter 41 | * `example/test.cc`: an example of using cuckoo filter 42 | * `benchmarks/`: Some benchmarks of speed, space used, and false positive rate 43 | 44 | 45 | Build 46 | ------- 47 | This libray depends on openssl library. Note that on MacOS 10.12, the header 48 | files of openssl are not available by default. It may require to install openssl 49 | and pass the path to `lib` and `include` directories to gcc, for example: 50 | 51 | ```bash 52 | $ brew install openssl 53 | # Replace 1.0.2j with the actual version of the openssl installed 54 | $ export LDFLAGS="-L/usr/local/Cellar/openssl/1.0.2j/lib" 55 | $ export CFLAGS="-I/usr/local/Cellar/openssl/1.0.2j/include" 56 | ``` 57 | 58 | To build the example (`example/test.cc`): 59 | ```bash 60 | $ make test 61 | ``` 62 | 63 | To build the benchmarks: 64 | ```bash 65 | $ cd benchmarks 66 | $ make 67 | ``` 68 | 69 | Install 70 | ------- 71 | To install the cuckoofilter library: 72 | ```bash 73 | $ make install 74 | ``` 75 | By default, the header files will be placed in `/usr/local/include/cuckoofilter` 76 | and the static library at `/usr/local/lib/cuckoofilter.a`. 77 | 78 | 79 | Contributing 80 | ------------ 81 | Contributions via GitHub pull requests are welcome. Please keep the code style guided by 82 | [Google C++ style](https://google.github.io/styleguide/cppguide.html). One can use 83 | [clang-format](http://clang.llvm.org/docs/ClangFormat.html) with our provided 84 | [`.clang-format`](https://github.com/efficient/cuckoofilter/blob/master/.clang-format) 85 | in this repository to enforce the style. 86 | 87 | 88 | 89 | Authors 90 | ------- 91 | - Bin Fan 92 | - David G. Andersen 93 | - Michael Kaminsky 94 | -------------------------------------------------------------------------------- /cuckoofilter/benchmarks/Makefile: -------------------------------------------------------------------------------- 1 | # Uncomment one of the following to switch between debug and opt mode 2 | OPT = -O3 -DNDEBUG 3 | #OPT = -g -ggdb 4 | 5 | CXXFLAGS += -fno-strict-aliasing -Wall -std=c++11 -I. -I../src/ $(OPT) -march=core-avx2 6 | 7 | LDFLAGS+= -Wall -lpthread -lssl -lcrypto 8 | 9 | HEADERS = $(wildcard ../src/*.h) *.h 10 | 11 | SRC = ../src/hashutil.cc 12 | 13 | .PHONY: all 14 | 15 | BINS = conext-table3.exe conext-figure5.exe bulk-insert-and-query.exe 16 | 17 | all: $(BINS) 18 | 19 | clean: 20 | /bin/rm -f $(BINS) 21 | 22 | %.exe: %.cc ${HEADERS} ${SRC} Makefile 23 | $(CXX) $(CXXFLAGS) $< -o $@ $(SRC) $(LDFLAGS) 24 | -------------------------------------------------------------------------------- /cuckoofilter/benchmarks/conext-figure5.cc: -------------------------------------------------------------------------------- 1 | // This benchmark reproduces the CoNEXT 2014 results found in "Figure 5: Lookup 2 | // performance when a filter achieves its capacity." It takes about two minutes to run on 3 | // an Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz. 4 | // 5 | // Results: 6 | // fraction of queries on existing items/lookup throughput (million OPS) 7 | // CF ss-CF 8 | // 0.00% 24.79 9.37 9 | // 25.00% 24.65 9.57 10 | // 50.00% 24.84 9.57 11 | // 75.00% 24.86 9.62 12 | // 100.00% 24.89 9.96 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #include "cuckoofilter.h" 19 | #include "random.h" 20 | #include "timing.h" 21 | 22 | using namespace std; 23 | 24 | using namespace cuckoofilter; 25 | 26 | // The number of items sampled when determining the lookup performance 27 | const size_t SAMPLE_SIZE = 1000 * 1000; 28 | 29 | // The time (in seconds) to lookup SAMPLE_SIZE keys in which 0%, 25%, 50%, 75%, and 100% 30 | // of the keys looked up are found. 31 | template 32 | array CuckooBenchmark( 33 | size_t add_count, const vector& to_add, const vector& to_lookup) { 34 | Table cuckoo(add_count); 35 | array result; 36 | 37 | // Add values until failure or until we run out of values to add: 38 | size_t added = 0; 39 | while (added < to_add.size() && 0 == cuckoo.Add(to_add[added])) ++added; 40 | 41 | // A value to track to prevent the compiler from optimizing out all lookups: 42 | size_t found_count = 0; 43 | for (const double found_percent : {0.0, 0.25, 0.50, 0.75, 1.00}) { 44 | const auto to_lookup_mixed = MixIn(&to_lookup[0], &to_lookup[SAMPLE_SIZE], &to_add[0], 45 | &to_add[added], found_percent); 46 | auto start_time = NowNanos(); 47 | for (const auto v : to_lookup_mixed) found_count += (0 == cuckoo.Contain(v)); 48 | auto lookup_time = NowNanos() - start_time; 49 | result[found_percent * 4] = lookup_time / (1000.0 * 1000.0 * 1000.0); 50 | } 51 | if (6 * SAMPLE_SIZE == found_count) exit(1); 52 | return result; 53 | } 54 | 55 | int main() { 56 | // Number of distinct values, used only for the constructor of CuckooFilter, which does 57 | // not allow the caller to specify the space usage directly. The actual number of 58 | // distinct items inserted depends on how many fit until an insert failure occurs. 59 | size_t add_count = 127.78 * 1000 * 1000; 60 | 61 | // Overestimate add_count so we don't run out of random data: 62 | const size_t max_add_count = 2 * add_count; 63 | const vector to_add = GenerateRandom64(max_add_count); 64 | const vector to_lookup = GenerateRandom64(SAMPLE_SIZE); 65 | 66 | // Calculate metrics: 67 | const auto cf = CuckooBenchmark< 68 | CuckooFilter>( 69 | add_count, to_add, to_lookup); 70 | const auto sscf = CuckooBenchmark< 71 | CuckooFilter>( 72 | add_count, to_add, to_lookup); 73 | 74 | cout << "fraction of queries on existing items/lookup throughput (million OPS) " 75 | << endl; 76 | cout << setw(10) << "" 77 | << " " << setw(10) << right << "CF" << setw(10) << right << "ss-CF" << endl; 78 | for (const double found_percent : {0.0, 0.25, 0.50, 0.75, 1.00}) { 79 | cout << fixed << setprecision(2) << setw(10) << right << 100 * found_percent << "%"; 80 | cout << setw(10) << right << (SAMPLE_SIZE / cf[found_percent * 4]) / (1000 * 1000); 81 | cout << setw(10) << right << (SAMPLE_SIZE / sscf[found_percent * 4]) / (1000 * 1000); 82 | cout << endl; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /cuckoofilter/benchmarks/conext-table3.cc: -------------------------------------------------------------------------------- 1 | // This benchmark reproduces the CoNEXT 2014 results found in "Table 3: Space efficiency 2 | // and construction speed." It takes about two minutes to run on an Intel(R) Core(TM) 3 | // i7-4790 CPU @ 3.60GHz. 4 | // 5 | // Results: 6 | // 7 | // metrics CF ss-CF 8 | // # of items (million) 127.82 127.90 9 | // bits per item 12.60 12.59 10 | // false positive rate 0.18% 0.09% 11 | // constr. speed (million keys/sec) 5.86 4.10 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #include "cuckoofilter.h" 18 | #include "random.h" 19 | #include "timing.h" 20 | 21 | using namespace std; 22 | 23 | using namespace cuckoofilter; 24 | 25 | // The number of items sampled when determining the false positive rate 26 | const size_t FPR_SAMPLE_SIZE = 1000 * 1000; 27 | 28 | struct Metrics { 29 | double add_count; // # of items (million) 30 | double space; // bits per item 31 | double fpr; // false positive rate (%) 32 | double speed; // const. speed (million keys/sec) 33 | }; 34 | 35 | template 36 | Metrics CuckooBenchmark(size_t add_count, const vector& input) { 37 | Table cuckoo(add_count); 38 | auto start_time = NowNanos(); 39 | 40 | // Insert until failure: 41 | size_t inserted = 0; 42 | while (inserted < input.size() && 0 == cuckoo.Add(input[inserted])) ++inserted; 43 | 44 | auto constr_time = NowNanos() - start_time; 45 | 46 | // Count false positives: 47 | size_t false_positive_count = 0; 48 | size_t absent = 0; 49 | for (; inserted + absent < input.size() && absent < FPR_SAMPLE_SIZE; ++absent) { 50 | false_positive_count += (0 == cuckoo.Contain(input[inserted + absent])); 51 | } 52 | 53 | // Calculate metrics: 54 | const auto time = constr_time / static_cast(1000 * 1000 * 1000); 55 | Metrics result; 56 | result.add_count = static_cast(inserted) / (1000 * 1000); 57 | result.space = static_cast(CHAR_BIT * cuckoo.SizeInBytes()) / inserted; 58 | result.fpr = (100.0 * false_positive_count) / absent; 59 | result.speed = (inserted / time) / (1000 * 1000); 60 | return result; 61 | } 62 | 63 | int main() { 64 | // Number of distinct values, used only for the constructor of CuckooFilter, which does 65 | // not allow the caller to specify the space usage directly. The actual number of 66 | // distinct items inserted depends on how many fit until an insert failure occurs. 67 | const size_t add_count = 127.78 * 1000 * 1000; 68 | 69 | // Overestimate add_count so we don't run out of random data: 70 | const size_t max_add_count = 2 * add_count; 71 | const vector input = GenerateRandom64(max_add_count + FPR_SAMPLE_SIZE); 72 | 73 | // Calculate metrics: 74 | const auto cf = CuckooBenchmark< 75 | CuckooFilter>( 76 | add_count, input); 77 | const auto sscf = CuckooBenchmark< 78 | CuckooFilter>( 79 | add_count, input); 80 | 81 | cout << setw(35) << left << "metrics " << setw(10) << right << "CF" << setw(10) 82 | << "ss-CF" << endl 83 | << fixed << setprecision(2) << setw(35) << left << "# of items (million) " 84 | << setw(10) << right << cf.add_count << setw(10) << sscf.add_count << endl 85 | << setw(35) << left << "bits per item " << setw(10) << right << cf.space 86 | << setw(10) << sscf.space << endl 87 | << setw(35) << left << "false positive rate " << setw(9) << right << cf.fpr << "%" 88 | << setw(9) << sscf.fpr << "%" << endl 89 | << setw(35) << left << "constr. speed (million keys/sec) " << setw(10) << right 90 | << cf.speed << setw(10) << sscf.speed << endl; 91 | } 92 | -------------------------------------------------------------------------------- /cuckoofilter/benchmarks/random.h: -------------------------------------------------------------------------------- 1 | // Generating random data 2 | 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | 13 | ::std::vector<::std::uint64_t> GenerateRandom64(::std::size_t count) { 14 | ::std::vector<::std::uint64_t> result(count); 15 | ::std::random_device random; 16 | // To generate random keys to lookup, this uses ::std::random_device which is slower but 17 | // stronger than some other pseudo-random alternatives. The reason is that some of these 18 | // alternatives (like libstdc++'s ::std::default_random, which is a linear congruential 19 | // generator) behave non-randomly under some hash families like Dietzfelbinger's 20 | // multiply-shift. 21 | auto genrand = [&random]() { 22 | return random() + (static_cast<::std::uint64_t>(random()) << 32); 23 | }; 24 | ::std::generate(result.begin(), result.end(), ::std::ref(genrand)); 25 | return result; 26 | } 27 | 28 | // Using two pointer ranges for sequences x and y, create a vector clone of x but for 29 | // y_probability y's mixed in. 30 | template 31 | ::std::vector MixIn(const T* x_begin, const T* x_end, const T* y_begin, const T* y_end, 32 | double y_probability) { 33 | const size_t x_size = x_end - x_begin, y_size = y_end - y_begin; 34 | if (y_size > (1ull << 32)) throw ::std::length_error("y is too long"); 35 | ::std::vector result(x_begin, x_end); 36 | ::std::random_device random; 37 | auto genrand = [&random, y_size]() { 38 | return (static_cast(random()) * y_size) >> 32; 39 | }; 40 | for (size_t i = 0; i < y_probability * x_size; ++i) { 41 | result[i] = *(y_begin + genrand()); 42 | } 43 | ::std::shuffle(result.begin(), result.end(), random); 44 | return result; 45 | } 46 | -------------------------------------------------------------------------------- /cuckoofilter/benchmarks/timing.h: -------------------------------------------------------------------------------- 1 | // Timers for use in benchmarking. 2 | 3 | #pragma once 4 | 5 | #include 6 | #include 7 | 8 | ::std::uint64_t NowNanos() { 9 | return ::std::chrono::duration_cast<::std::chrono::nanoseconds>( 10 | ::std::chrono::steady_clock::now().time_since_epoch()) 11 | .count(); 12 | } 13 | -------------------------------------------------------------------------------- /cuckoofilter/example/test.cc: -------------------------------------------------------------------------------- 1 | #include "cuckoofilter.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | using cuckoofilter::CuckooFilter; 10 | 11 | int main(int argc, char **argv) { 12 | size_t total_items = 1000000; 13 | 14 | // Create a cuckoo filter where each item is of type size_t and 15 | // use 12 bits for each item: 16 | // CuckooFilter filter(total_items); 17 | // To enable semi-sorting, define the storage of cuckoo filter to be 18 | // PackedTable, accepting keys of size_t type and making 13 bits 19 | // for each key: 20 | // CuckooFilter filter(total_items); 21 | CuckooFilter filter(total_items); 22 | 23 | // Insert items to this cuckoo filter 24 | size_t num_inserted = 0; 25 | for (size_t i = 0; i < total_items; i++, num_inserted++) { 26 | if (filter.Add(i) != cuckoofilter::Ok) { 27 | break; 28 | } 29 | } 30 | 31 | // Check if previously inserted items are in the filter, expected 32 | // true for all items 33 | for (size_t i = 0; i < num_inserted; i++) { 34 | assert(filter.Contain(i) == cuckoofilter::Ok); 35 | } 36 | 37 | // Check non-existing items, a few false positives expected 38 | size_t total_queries = 0; 39 | size_t false_queries = 0; 40 | for (size_t i = total_items; i < 2 * total_items; i++) { 41 | if (filter.Contain(i) == cuckoofilter::Ok) { 42 | false_queries++; 43 | } 44 | total_queries++; 45 | } 46 | 47 | // Output the measured false positive rate 48 | std::cout << "false positive rate is " 49 | << 100.0 * false_queries / total_queries << "%\n"; 50 | 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /cuckoofilter/src/bitsutil.h: -------------------------------------------------------------------------------- 1 | #ifndef CUCKOO_FILTER_BITS_H_ 2 | #define CUCKOO_FILTER_BITS_H_ 3 | 4 | namespace cuckoofilter { 5 | 6 | // inspired from 7 | // http://www-graphics.stanford.edu/~seander/bithacks.html#ZeroInWord 8 | #define haszero4(x) (((x)-0x1111ULL) & (~(x)) & 0x8888ULL) 9 | #define hasvalue4(x, n) (haszero4((x) ^ (0x1111ULL * (n)))) 10 | 11 | #define haszero8(x) (((x)-0x01010101ULL) & (~(x)) & 0x80808080ULL) 12 | #define hasvalue8(x, n) (haszero8((x) ^ (0x01010101ULL * (n)))) 13 | 14 | #define haszero12(x) (((x)-0x001001001001ULL) & (~(x)) & 0x800800800800ULL) 15 | #define hasvalue12(x, n) (haszero12((x) ^ (0x001001001001ULL * (n)))) 16 | 17 | #define haszero16(x) \ 18 | (((x)-0x0001000100010001ULL) & (~(x)) & 0x8000800080008000ULL) 19 | #define hasvalue16(x, n) (haszero16((x) ^ (0x0001000100010001ULL * (n)))) 20 | 21 | inline uint64_t upperpower2(uint64_t x) { 22 | x--; 23 | x |= x >> 1; 24 | x |= x >> 2; 25 | x |= x >> 4; 26 | x |= x >> 8; 27 | x |= x >> 16; 28 | x |= x >> 32; 29 | x++; 30 | return x; 31 | } 32 | 33 | } // namespace cuckoofilter 34 | 35 | #endif // CUCKOO_FILTER_BITS_H 36 | -------------------------------------------------------------------------------- /cuckoofilter/src/cuckoofilter.h: -------------------------------------------------------------------------------- 1 | #ifndef CUCKOO_FILTER_CUCKOO_FILTER_H_ 2 | #define CUCKOO_FILTER_CUCKOO_FILTER_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "debug.h" 8 | #include "hashutil.h" 9 | #include "packedtable.h" 10 | #include "printutil.h" 11 | #include "singletable.h" 12 | 13 | namespace cuckoofilter { 14 | // status returned by a cuckoo filter operation 15 | enum Status { 16 | Ok = 0, 17 | NotFound = 1, 18 | NotEnoughSpace = 2, 19 | NotSupported = 3, 20 | }; 21 | 22 | // maximum number of cuckoo kicks before claiming failure 23 | const size_t kMaxCuckooCount = 500; 24 | 25 | // A cuckoo filter class exposes a Bloomier filter interface, 26 | // providing methods of Add, Delete, Contain. It takes three 27 | // template parameters: 28 | // ItemType: the type of item you want to insert 29 | // bits_per_item: how many bits each item is hashed into 30 | // TableType: the storage of table, SingleTable by default, and 31 | // PackedTable to enable semi-sorting 32 | template class TableType = SingleTable, 34 | typename HashFamily = TwoIndependentMultiplyShift> 35 | class CuckooFilter { 36 | // Storage of items 37 | TableType *table_; 38 | 39 | // Number of items stored 40 | size_t num_items_; 41 | 42 | typedef struct { 43 | size_t index; 44 | uint32_t tag; 45 | bool used; 46 | } VictimCache; 47 | 48 | VictimCache victim_; 49 | 50 | HashFamily hasher_; 51 | 52 | inline size_t IndexHash(uint32_t hv) const { 53 | // table_->num_buckets is always a power of two, so modulo can be replaced 54 | // with 55 | // bitwise-and: 56 | return hv & (table_->NumBuckets() - 1); 57 | } 58 | 59 | inline uint32_t TagHash(uint32_t hv) const { 60 | uint32_t tag; 61 | tag = hv & ((1ULL << bits_per_item) - 1); 62 | tag += (tag == 0); 63 | return tag; 64 | } 65 | 66 | inline void GenerateIndexTagHash(const ItemType &item, size_t *index, 67 | uint32_t *tag) const { 68 | const uint64_t hash = hasher_(item); 69 | // const uint64_t hash = item; 70 | *index = IndexHash(hash >> 32); 71 | *tag = TagHash(hash); 72 | } 73 | 74 | inline size_t AltIndex(const size_t index, const uint32_t tag) const { 75 | // NOTE(binfan): originally we use: 76 | // index ^ HashUtil::BobHash((const void*) (&tag), 4)) & table_->INDEXMASK; 77 | // now doing a quick-n-dirty way: 78 | // 0x5bd1e995 is the hash constant from MurmurHash2 79 | return IndexHash((uint32_t)(index ^ (tag * 0x5bd1e995))); 80 | // uint64_t temp_index = (index ^ (tag * 0xc4ceb9fe1a85ec53L)); 81 | // return IndexHash(temp_index); 82 | } 83 | 84 | Status AddImpl(const size_t i, const uint32_t tag); 85 | 86 | // load factor is the fraction of occupancy 87 | double LoadFactor() const { return 1.0 * Size() / table_->SizeInTags(); } 88 | 89 | double BitsPerItem() const { return 8.0 * table_->SizeInBytes() / Size(); } 90 | 91 | public: 92 | explicit CuckooFilter(const size_t max_num_keys) 93 | : num_items_(0), victim_(), hasher_() { 94 | size_t assoc = 4; 95 | size_t num_buckets = 96 | upperpower2(std::max(1, max_num_keys / assoc)); 97 | double frac = (double)max_num_keys / num_buckets / assoc; 98 | if (frac > 0.96) { 99 | std::cout << "CF might fail." << std::endl; 100 | // num_buckets <<= 1; 101 | } 102 | victim_.used = false; 103 | table_ = new TableType(num_buckets); 104 | // std::cout << "load is: " << frac << std::endl; 105 | // std::cout << "Here!" << std::endl; 106 | // std::cout << __LINE__ << std::endl; 107 | } 108 | 109 | ~CuckooFilter() { 110 | // std::cout << "CF-??? " << "Byte size is: \t" << SizeInBytes() << 111 | // std::endl; 112 | delete table_; 113 | } 114 | 115 | // Add an item to the filter. 116 | Status Add(const ItemType &item); 117 | 118 | // Report if the item is inserted, with false positive rate. 119 | Status Contain(const ItemType &item) const; 120 | 121 | // Delete an key from the filter 122 | Status Delete(const ItemType &item); 123 | 124 | /* methods for providing stats */ 125 | // summary infomation 126 | std::string Info() const; 127 | 128 | // number of current inserted items; 129 | size_t Size() const { return num_items_; } 130 | 131 | // size of the filter in bytes. 132 | size_t SizeInBytes() const { return table_->SizeInBytes(); } 133 | 134 | size_t get_cap() const { return num_items_; } 135 | }; 136 | 137 | template class TableType, typename HashFamily> 139 | Status CuckooFilter::Add( 140 | const ItemType &item) { 141 | size_t i; 142 | uint32_t tag; 143 | 144 | if (victim_.used) { 145 | #ifndef NDEBUG 146 | std::cout << std::string(80, '=') << std::endl; 147 | if (Contain(item) == Ok) { 148 | std::cout << "Item was already in the set." << std::endl; 149 | } else { 150 | std::cout << "Item was not already in the set." << std::endl; 151 | } 152 | std::cout << "Info: "; 153 | std::cout << std::string(80, '=') << std::endl; 154 | #endif //! NDEBUG 155 | std::cout << Info(); 156 | 157 | return NotEnoughSpace; 158 | } 159 | 160 | GenerateIndexTagHash(item, &i, &tag); 161 | return AddImpl(i, tag); 162 | } 163 | 164 | template class TableType, typename HashFamily> 166 | Status CuckooFilter::AddImpl( 167 | const size_t i, const uint32_t tag) { 168 | size_t curindex = i; 169 | uint32_t curtag = tag; 170 | uint32_t oldtag; 171 | 172 | for (uint32_t count = 0; count < kMaxCuckooCount; count++) { 173 | bool kickout = count > 0; 174 | oldtag = 0; 175 | if (table_->InsertTagToBucket(curindex, curtag, kickout, oldtag)) { 176 | num_items_++; 177 | return Ok; 178 | } 179 | if (kickout) { 180 | curtag = oldtag; 181 | } 182 | curindex = AltIndex(curindex, curtag); 183 | } 184 | 185 | victim_.index = curindex; 186 | victim_.tag = curtag; 187 | victim_.used = true; 188 | return Ok; 189 | } 190 | 191 | template class TableType, typename HashFamily> 193 | Status CuckooFilter::Contain( 194 | const ItemType &key) const { 195 | bool found = false; 196 | size_t i1, i2; 197 | uint32_t tag; 198 | 199 | GenerateIndexTagHash(key, &i1, &tag); 200 | i2 = AltIndex(i1, tag); 201 | 202 | assert(i1 == AltIndex(i2, tag)); 203 | 204 | found = victim_.used && (tag == victim_.tag) && 205 | (i1 == victim_.index || i2 == victim_.index); 206 | 207 | if (found || table_->FindTagInBuckets(i1, i2, tag)) { 208 | return Ok; 209 | } else { 210 | return NotFound; 211 | } 212 | } 213 | 214 | template class TableType, typename HashFamily> 216 | Status CuckooFilter::Delete( 217 | const ItemType &key) { 218 | size_t i1, i2; 219 | uint32_t tag; 220 | 221 | GenerateIndexTagHash(key, &i1, &tag); 222 | i2 = AltIndex(i1, tag); 223 | 224 | if (table_->DeleteTagFromBucket(i1, tag)) { 225 | num_items_--; 226 | goto TryEliminateVictim; 227 | } else if (table_->DeleteTagFromBucket(i2, tag)) { 228 | num_items_--; 229 | goto TryEliminateVictim; 230 | } else if (victim_.used && tag == victim_.tag && 231 | (i1 == victim_.index || i2 == victim_.index)) { 232 | // num_items_--; 233 | victim_.used = false; 234 | return Ok; 235 | } else { 236 | return NotFound; 237 | } 238 | TryEliminateVictim: 239 | if (victim_.used) { 240 | victim_.used = false; 241 | size_t i = victim_.index; 242 | uint32_t tag = victim_.tag; 243 | AddImpl(i, tag); 244 | } 245 | return Ok; 246 | } 247 | 248 | template class TableType, typename HashFamily> 250 | std::string CuckooFilter::Info() 251 | const { 252 | std::stringstream ss; 253 | ss << "CuckooFilter Status:\n" 254 | << "\t\t" << table_->Info() << "\n" 255 | << "\t\tKeys stored: " << Size() << "\n" 256 | << "\t\tLoad factor: " << LoadFactor() << "\n" 257 | << "\t\tHashtable size: " << (table_->SizeInBytes() >> 10) << " KB\n"; 258 | if (Size() > 0) { 259 | ss << "\t\tbit/key: " << BitsPerItem() << "\n"; 260 | } else { 261 | ss << "\t\tbit/key: N/A\n"; 262 | } 263 | return ss.str(); 264 | } 265 | 266 | } // namespace cuckoofilter 267 | #endif // CUCKOO_FILTER_CUCKOO_FILTER_H_ 268 | -------------------------------------------------------------------------------- /cuckoofilter/src/cuckoofilter_stable.h: -------------------------------------------------------------------------------- 1 | #ifndef CUCKOO_FILTER_STABLE_CUCKOO_FILTER_STABLE_H_ 2 | #define CUCKOO_FILTER_STABLE_CUCKOO_FILTER_STABLE_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "debug.h" 8 | #include "hashutil.h" 9 | #include "packedtable.h" 10 | #include "printutil.h" 11 | #include "singletable.h" 12 | 13 | namespace cuckoofilter { 14 | 15 | inline uint32_t reduce(uint64_t hash, uint32_t n) { 16 | // http://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/ 17 | return (uint32_t)(((hash & 0xffffffffL) * n) >> 32); 18 | } 19 | 20 | // A stable cuckoo filter class exposes a Bloomier filter interface, 21 | // providing methods of Add, Delete, Contain. It takes three 22 | // template parameters: 23 | // ItemType: the type of item you want to insert 24 | // bits_per_item: how many bits each item is hashed into 25 | // TableType: the storage of table, SingleTable by default, and 26 | // PackedTable to enable semi-sorting 27 | template class TableType = SingleTable, 29 | typename HashFamily = TwoIndependentMultiplyShift> 30 | class CuckooFilterStable { 31 | // Storage of items 32 | TableType *table_; 33 | size_t bucketCount; 34 | 35 | // Number of items stored 36 | size_t num_items_; 37 | 38 | typedef struct { 39 | size_t index; 40 | uint32_t tag; 41 | bool used; 42 | } VictimCache; 43 | 44 | VictimCache victim_; 45 | 46 | HashFamily hasher_; 47 | 48 | inline size_t IndexHash(uint32_t hv) const { 49 | size_t x = reduce(hv, bucketCount); 50 | return x; 51 | } 52 | 53 | inline uint32_t TagHash(uint32_t hv) const { 54 | uint32_t tag; 55 | tag = hv & ((1ULL << bits_per_item) - 1); 56 | tag += (tag == 0); 57 | return tag; 58 | } 59 | 60 | inline void GenerateIndexTagHash(const ItemType &item, size_t *index, 61 | uint32_t *tag) const { 62 | const uint64_t hash = hasher_(item); 63 | // const uint64_t hash = item; 64 | // *index = IndexHash(hash >> 32); Mistake! 65 | *index = IndexHash((uint32_t)hash); 66 | *tag = TagHash(hash >> 32); 67 | } 68 | 69 | inline size_t AltIndex(const size_t index, const uint32_t tag) const { 70 | // NOTE(binfan): originally we use: 71 | // index ^ HashUtil::BobHash((const void*) (&tag), 4)) & table_->INDEXMASK; 72 | // now doing a quick-n-dirty way: 73 | // 0x5bd1e995 is the hash constant from MurmurHash2 74 | // return IndexHash((uint32_t)(index ^ (tag * 0x5bd1e995))); 75 | 76 | uint64_t hash = tag * 0xc4ceb9fe1a85ec53L; 77 | // we don't use xor; instead, we ensure bucketCount is even, 78 | // and bucket2 = bucketCount - bucket - y, 79 | // and if negative add the bucketCount, 80 | // where y is 1..bucketCount - 1 and odd - 81 | // that way, bucket2 is never the original bucket, 82 | // and running this twice will give the original bucket, as needed 83 | uint32_t r = (reduce(hash, bucketCount >> 1) << 1) + 1; 84 | 85 | // this is needed because the bucket size is not always 2^n: 86 | int32_t b2 = bucketCount - index - r; 87 | if (b2 < 0) { 88 | b2 += bucketCount; 89 | } 90 | 91 | // I tried the following alternatives (also combinations), 92 | // but performance is the same: 93 | 94 | // uint32_t b2 = bucketCount - index - r; 95 | // b2 += bucketCount * (b2 >> 31); 96 | 97 | // int32_t b2 = bucketCount - index - r; 98 | // b2 += bucketCount & (b2 >> 31); 99 | 100 | // int32_t b2 = r - index; 101 | // b2 += bucketCount & (b2 >> 31); 102 | 103 | return b2; 104 | } 105 | 106 | Status AddImpl(const size_t i, const uint32_t tag); 107 | 108 | // load factor is the fraction of occupancy 109 | double LoadFactor() const { return 1.0 * Size() / table_->SizeInTags(); } 110 | 111 | double BitsPerItem() const { return 8.0 * table_->SizeInBytes() / Size(); } 112 | 113 | public: 114 | size_t get_cap() const { return num_items_; } 115 | 116 | double get_effective_load() const { 117 | return LoadFactor(); 118 | } 119 | 120 | explicit CuckooFilterStable(const size_t max_num_keys) 121 | : num_items_(0), victim_(), hasher_() { 122 | size_t assoc = 4; 123 | // bucket count needs to be even 124 | constexpr double load = .94; 125 | bucketCount = (10 + max_num_keys / load / assoc) / 2 * 2; 126 | // std::cout << "bucketCount: " << bucketCount << std::endl; 127 | victim_.used = false; 128 | table_ = new TableType(bucketCount); 129 | } 130 | 131 | ~CuckooFilterStable() { delete table_; } 132 | 133 | // Add an item to the filter. 134 | Status Add(const ItemType &item); 135 | 136 | // Report if the item is inserted, with false positive rate. 137 | Status Contain(const ItemType &item) const; 138 | 139 | // Delete an key from the filter 140 | Status Delete(const ItemType &item); 141 | 142 | /* methods for providing stats */ 143 | // summary infomation 144 | std::string Info() const; 145 | 146 | // number of current inserted items; 147 | size_t Size() const { return num_items_; } 148 | 149 | // size of the filter in bytes. 150 | size_t SizeInBytes() const { return table_->SizeInBytes(); } 151 | }; 152 | 153 | template class TableType, typename HashFamily> 155 | Status CuckooFilterStable::Add( 156 | const ItemType &item) { 157 | size_t i; 158 | uint32_t tag; 159 | 160 | if (victim_.used) { 161 | return NotEnoughSpace; 162 | } 163 | 164 | GenerateIndexTagHash(item, &i, &tag); 165 | return AddImpl(i, tag); 166 | } 167 | 168 | template class TableType, typename HashFamily> 170 | Status CuckooFilterStable::AddImpl(const size_t i, 172 | const uint32_t tag) { 173 | size_t curindex = i; 174 | uint32_t curtag = tag; 175 | uint32_t oldtag; 176 | 177 | for (uint32_t count = 0; count < kMaxCuckooCount; count++) { 178 | bool kickout = count > 0; 179 | oldtag = 0; 180 | if (table_->InsertTagToBucket(curindex, curtag, kickout, oldtag)) { 181 | num_items_++; 182 | return Ok; 183 | } 184 | if (kickout) { 185 | curtag = oldtag; 186 | } 187 | curindex = AltIndex(curindex, curtag); 188 | } 189 | 190 | victim_.index = curindex; 191 | victim_.tag = curtag; 192 | victim_.used = true; 193 | return Ok; 194 | } 195 | 196 | template class TableType, typename HashFamily> 198 | Status CuckooFilterStable::Contain(const ItemType &key) const { 200 | bool found = false; 201 | size_t i1, i2; 202 | uint32_t tag; 203 | 204 | GenerateIndexTagHash(key, &i1, &tag); 205 | i2 = AltIndex(i1, tag); 206 | 207 | assert(i1 == AltIndex(i2, tag)); 208 | 209 | found = victim_.used && (tag == victim_.tag) && 210 | (i1 == victim_.index || i2 == victim_.index); 211 | 212 | if (found || table_->FindTagInBuckets(i1, i2, tag)) { 213 | return Ok; 214 | } else { 215 | return NotFound; 216 | } 217 | } 218 | 219 | template class TableType, typename HashFamily> 221 | Status CuckooFilterStable::Delete(const ItemType &key) { 223 | size_t i1, i2; 224 | uint32_t tag; 225 | 226 | GenerateIndexTagHash(key, &i1, &tag); 227 | i2 = AltIndex(i1, tag); 228 | 229 | if (table_->DeleteTagFromBucket(i1, tag)) { 230 | num_items_--; 231 | goto TryEliminateVictim; 232 | } else if (table_->DeleteTagFromBucket(i2, tag)) { 233 | num_items_--; 234 | goto TryEliminateVictim; 235 | } else if (victim_.used && tag == victim_.tag && 236 | (i1 == victim_.index || i2 == victim_.index)) { 237 | // num_items_--; 238 | victim_.used = false; 239 | return Ok; 240 | } else { 241 | return NotFound; 242 | } 243 | TryEliminateVictim: 244 | if (victim_.used) { 245 | victim_.used = false; 246 | size_t i = victim_.index; 247 | uint32_t tag = victim_.tag; 248 | AddImpl(i, tag); 249 | } 250 | return Ok; 251 | } 252 | 253 | template class TableType, typename HashFamily> 255 | std::string CuckooFilterStable::Info() const { 257 | std::stringstream ss; 258 | ss << "CuckooFilterStable Status:\n" 259 | << "\t\t" << table_->Info() << "\n" 260 | << "\t\tKeys stored: " << Size() << "\n" 261 | << "\t\tLoad factor: " << LoadFactor() << "\n" 262 | << "\t\tHashtable size: " << (table_->SizeInBytes() >> 10) << " KB\n"; 263 | if (Size() > 0) { 264 | ss << "\t\tbit/key: " << BitsPerItem() << "\n"; 265 | } else { 266 | ss << "\t\tbit/key: N/A\n"; 267 | } 268 | return ss.str(); 269 | } 270 | } // namespace cuckoofilter 271 | #endif // CUCKOO_FILTER_STABLE_CUCKOO_FILTER_STABLE_H_ 272 | -------------------------------------------------------------------------------- /cuckoofilter/src/debug.h: -------------------------------------------------------------------------------- 1 | #ifndef CUCKOO_FILTER_DEBUG_H_ 2 | #define CUCKOO_FILTER_DEBUG_H_ 3 | 4 | #include // for perror 5 | 6 | namespace cuckoofilter { 7 | 8 | #ifndef DEBUG 9 | //#define DEBUG 10 | #endif 11 | 12 | #define debug_level (DEBUG_ERRS | DEBUG_CUCKOO) 13 | 14 | #ifdef DEBUG 15 | // extern unsigned int debug; 16 | 17 | /* 18 | * a combination of DEBUG_ERRS, DEBUG_CUCKOO, DEBUG_TABLE, DEBUG_ENCODE 19 | */ 20 | 21 | #define DPRINTF(level, ...) \ 22 | do { \ 23 | if (debug_level & (level)) fprintf(stdout, ##__VA_ARGS__); \ 24 | } while (0) 25 | #define DEBUG_PERROR(errmsg) \ 26 | do { \ 27 | if (debug_level & DEBUG_ERRS) perror(errmsg); \ 28 | } while (0) 29 | 30 | #else 31 | 32 | #define DPRINTF(level, ...) 33 | #define DEBUG_PERROR(level, ...) 34 | 35 | #endif 36 | 37 | /* 38 | * The format of this should be obvious. Please add some explanatory 39 | * text if you add a debugging value. This text will show up in 40 | * -d list 41 | */ 42 | #define DEBUG_NONE 0x00 // DBTEXT: No debugging 43 | #define DEBUG_ERRS 0x01 // DBTEXT: Verbose error reporting 44 | #define DEBUG_CUCKOO 0x02 // DBTEXT: Messages for cuckoo hashing 45 | #define DEBUG_TABLE 0x04 // DBTEXT: Messages for table operations 46 | #define DEBUG_ENCODE 0x08 // DBTEXT: Messages for encoding 47 | 48 | #define DEBUG_ALL 0xffffffff 49 | 50 | // int set_debug(char *arg); /* Returns 0 on success, -1 on failure */ 51 | 52 | } // namespace cuckoofilter 53 | 54 | #endif // CUCKOO_FILTER_DEBUG_H_ 55 | -------------------------------------------------------------------------------- /cuckoofilter/src/hashutil.h: -------------------------------------------------------------------------------- 1 | #ifndef CUCKOO_FILTER_HASHUTIL_H_ 2 | #define CUCKOO_FILTER_HASHUTIL_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | // #include 11 | #include 12 | 13 | namespace cuckoofilter { 14 | 15 | class HashUtil { 16 | public: 17 | // Bob Jenkins Hash 18 | static uint32_t BobHash(const void *buf, size_t length, uint32_t seed = 0); 19 | static uint32_t BobHash(const std::string &s, uint32_t seed = 0); 20 | 21 | // Bob Jenkins Hash that returns two indices in one call 22 | // Useful for Cuckoo hashing, power of two choices, etc. 23 | // Use idx1 before idx2, when possible. idx1 and idx2 should be initialized to 24 | // seeds. 25 | static void BobHash(const void *buf, size_t length, uint32_t *idx1, 26 | uint32_t *idx2); 27 | static void BobHash(const std::string &s, uint32_t *idx1, uint32_t *idx2); 28 | 29 | // MurmurHash2 30 | static uint32_t MurmurHash(const void *buf, size_t length, uint32_t seed = 0); 31 | static uint32_t MurmurHash(const std::string &s, uint32_t seed = 0); 32 | 33 | // SuperFastHash 34 | static uint32_t SuperFastHash(const void *buf, size_t len); 35 | static uint32_t SuperFastHash(const std::string &s); 36 | 37 | // Null hash (shift and mask) 38 | static uint32_t NullHash(const void *buf, size_t length, uint32_t shiftbytes); 39 | 40 | // Wrappers for MD5 and SHA1 hashing using EVP 41 | static std::string MD5Hash(const char *inbuf, size_t in_length); 42 | static std::string SHA1Hash(const char *inbuf, size_t in_length); 43 | 44 | private: 45 | HashUtil(); 46 | }; 47 | 48 | // See Martin Dietzfelbinger, "Universal hashing and k-wise independent random 49 | // variables via integer arithmetic without primes". 50 | class TwoIndependentMultiplyShift { 51 | unsigned __int128 multiply_, add_; 52 | 53 | public: 54 | TwoIndependentMultiplyShift() { 55 | std::uint_least64_t seed; 56 | sysrandom(&seed, sizeof(seed)); 57 | std::mt19937_64 rng(seed); 58 | std::uniform_int_distribution dist(0, UINT64_MAX); 59 | 60 | for (auto v : {&multiply_, &add_}) { 61 | for (size_t i = 0; i < 8; i++) { 62 | unsigned __int128 hi = dist(rng); 63 | unsigned __int128 lo = dist(rng); 64 | *v ^= (hi << 64) | lo; 65 | } 66 | } 67 | // ::std::random_device random; 68 | // for (auto v : {&multiply_, &add_}) { 69 | // *v = random(); 70 | // for (int i = 1; i <= 4; ++i) { 71 | // *v = *v << 32; 72 | // *v |= random(); 73 | // } 74 | // } 75 | } 76 | 77 | uint64_t operator()(uint64_t key) const { 78 | return (add_ + multiply_ * static_cast(key)) >> 64; 79 | } 80 | 81 | inline size_t sysrandom(void *dst, size_t dstlen) { 82 | char *buffer = reinterpret_cast(dst); 83 | std::ifstream stream("/dev/urandom", 84 | std::ios_base::binary | std::ios_base::in); 85 | stream.read(buffer, dstlen); 86 | 87 | return dstlen; 88 | } 89 | }; 90 | 91 | // See Patrascu and Thorup's "The Power of Simple Tabulation Hashing" 92 | class SimpleTabulation { 93 | uint64_t tables_[sizeof(uint64_t)][1 << CHAR_BIT]; 94 | 95 | public: 96 | SimpleTabulation() { 97 | ::std::random_device random; 98 | for (unsigned i = 0; i < sizeof(uint64_t); ++i) { 99 | for (int j = 0; j < (1 << CHAR_BIT); ++j) { 100 | tables_[i][j] = random() | ((static_cast(random())) << 32); 101 | } 102 | } 103 | } 104 | 105 | uint64_t operator()(uint64_t key) const { 106 | uint64_t result = 0; 107 | for (unsigned i = 0; i < sizeof(key); ++i) { 108 | result ^= tables_[i][reinterpret_cast(&key)[i]]; 109 | } 110 | return result; 111 | } 112 | }; 113 | } // namespace cuckoofilter 114 | 115 | #endif // CUCKOO_FILTER_HASHUTIL_H_ 116 | -------------------------------------------------------------------------------- /cuckoofilter/src/permencoding.h: -------------------------------------------------------------------------------- 1 | #ifndef CUCKOO_FILTER_PERM_ENCODING_H_ 2 | #define CUCKOO_FILTER_PERM_ENCODING_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | #include "debug.h" 12 | 13 | namespace cuckoofilter { 14 | 15 | class PermEncoding { 16 | /* unpack one 2-byte number to four 4-bit numbers */ 17 | // inline void unpack(const uint16_t in, const uint8_t out[4]) const { 18 | // (*(uint16_t *)out) = in & 0x0f0f; 19 | // (*(uint16_t *)(out +2)) = (in >> 4) & 0x0f0f; 20 | // } 21 | 22 | inline void unpack(uint16_t in, uint8_t out[4]) const { 23 | out[0] = (in & 0x000f); 24 | out[2] = ((in >> 4) & 0x000f); 25 | out[1] = ((in >> 8) & 0x000f); 26 | out[3] = ((in >> 12) & 0x000f); 27 | } 28 | 29 | /* pack four 4-bit numbers to one 2-byte number */ 30 | inline uint16_t pack(const uint8_t in[4]) const { 31 | uint16_t in1 = *((uint16_t *)(in)) & 0x0f0f; 32 | uint16_t in2 = *((uint16_t *)(in + 2)) << 4; 33 | return in1 | in2; 34 | } 35 | 36 | public: 37 | PermEncoding() { 38 | uint8_t dst[4]; 39 | uint16_t idx = 0; 40 | memset(dec_table, 0, sizeof(dec_table)); 41 | memset(enc_table, 0, sizeof(enc_table)); 42 | gen_tables(0, 0, dst, idx); 43 | } 44 | 45 | ~PermEncoding() {} 46 | 47 | static const size_t N_ENTS = 3876; 48 | 49 | uint16_t dec_table[N_ENTS]; 50 | uint16_t enc_table[1 << 16]; 51 | 52 | inline void decode(const uint16_t codeword, uint8_t lowbits[4]) const { 53 | unpack(dec_table[codeword], lowbits); 54 | } 55 | 56 | inline uint16_t encode(const uint8_t lowbits[4]) const { 57 | if (DEBUG_ENCODE & debug_level) { 58 | printf("Perm.encode\n"); 59 | for (int i = 0; i < 4; i++) { 60 | printf("encode lowbits[%d]=%x\n", i, lowbits[i]); 61 | } 62 | printf("pack(lowbits) = %x\n", pack(lowbits)); 63 | printf("enc_table[%x]=%x\n", pack(lowbits), enc_table[pack(lowbits)]); 64 | } 65 | 66 | return enc_table[pack(lowbits)]; 67 | } 68 | 69 | void gen_tables(int base, int k, uint8_t dst[4], uint16_t &idx) { 70 | for (int i = base; i < 16; i++) { 71 | /* for fast comparison in binary_search in little-endian machine */ 72 | dst[k] = i; 73 | if (k + 1 < 4) { 74 | gen_tables(i, k + 1, dst, idx); 75 | } else { 76 | dec_table[idx] = pack(dst); 77 | enc_table[pack(dst)] = idx; 78 | if (DEBUG_ENCODE & debug_level) { 79 | printf("enc_table[%04x]=%04x\t%x %x %x %x\n", pack(dst), idx, dst[0], 80 | dst[1], dst[2], dst[3]); 81 | } 82 | idx++; 83 | } 84 | } 85 | } 86 | }; 87 | } // namespace cuckoofilter 88 | #endif // CUCKOO_FILTER_PERM_ENCODING_H_ 89 | -------------------------------------------------------------------------------- /cuckoofilter/src/printutil.cc: -------------------------------------------------------------------------------- 1 | // #include "printutil.h" 2 | // #include 3 | // #include 4 | 5 | // namespace cuckoofilter { 6 | 7 | // std::string PrintUtil::bytes_to_hex(const char *data, size_t len) { 8 | // std::string hexstr = ""; 9 | // static const char hexes[] = "0123456789ABCDEF "; 10 | 11 | // for (size_t i = 0; i < len; i++) { 12 | // unsigned char c = data[i]; 13 | // hexstr.push_back(hexes[c >> 4]); 14 | // hexstr.push_back(hexes[c & 0xf]); 15 | // hexstr.push_back(hexes[16]); 16 | // } 17 | // return hexstr; 18 | // }; 19 | 20 | // std::string PrintUtil::bytes_to_hex(const std::string &s) { 21 | // return bytes_to_hex((const char *)s.data(), s.size()); 22 | // }; 23 | 24 | // } // namespace cuckoofilter 25 | -------------------------------------------------------------------------------- /cuckoofilter/src/printutil.h: -------------------------------------------------------------------------------- 1 | #ifndef CUCKOO_FILTER_PRINTUTIL_H_ 2 | #define CUCKOO_FILTER_PRINTUTIL_H_ 3 | 4 | #include 5 | 6 | namespace cuckoofilter { 7 | class PrintUtil { 8 | public: 9 | static std::string bytes_to_hex(const char *data, size_t len) { 10 | std::string hexstr = ""; 11 | static const char hexes[] = "0123456789ABCDEF "; 12 | 13 | for (size_t i = 0; i < len; i++) { 14 | unsigned char c = data[i]; 15 | hexstr.push_back(hexes[c >> 4]); 16 | hexstr.push_back(hexes[c & 0xf]); 17 | hexstr.push_back(hexes[16]); 18 | } 19 | return hexstr; 20 | } 21 | 22 | static std::string bytes_to_hex(const std::string &s) { 23 | return bytes_to_hex((const char *)s.data(), s.size()); 24 | } 25 | 26 | private: 27 | PrintUtil(); 28 | }; // class PrintUtil 29 | 30 | } // namespace cuckoofilter 31 | 32 | #endif // CUCKOO_FILTER_PRINTUTIL_H_ 33 | -------------------------------------------------------------------------------- /cuckoofilter/src/simd-block.h: -------------------------------------------------------------------------------- 1 | // // Copied from Apache Impala (incubating), usable under the terms in the Apache License, 2 | // // Version 2.0. 3 | 4 | // // This is a block Bloom filter (from Putze et al.'s "Cache-, Hash- and Space-Efficient 5 | // // Bloom Filters") with some twists: 6 | // // 7 | // // 1. Each block is a split Bloom filter - see Section 2.1 of Broder and Mitzenmacher's 8 | // // "Network Applications of Bloom Filters: A Survey". 9 | // // 10 | // // 2. The number of bits set per Add() is contant in order to take advantage of SIMD 11 | // // instructions. 12 | 13 | // #pragma once 14 | 15 | // #include 16 | // #include 17 | 18 | // #include 19 | // #include 20 | 21 | // #include 22 | 23 | // #include "hashutil.h" 24 | 25 | // using uint32_t = ::std::uint32_t; 26 | // using uint64_t = ::std::uint64_t; 27 | 28 | // template 29 | // class SimdBlockFilter { 30 | // private: 31 | // // The filter is divided up into Buckets: 32 | // using Bucket = uint32_t[8]; 33 | 34 | // // log2(number of bytes in a bucket): 35 | // static constexpr int LOG_BUCKET_BYTE_SIZE = 5; 36 | 37 | // static_assert( 38 | // (1 << LOG_BUCKET_BYTE_SIZE) == sizeof(Bucket) && sizeof(Bucket) == sizeof(__m256i), 39 | // "Bucket sizing has gone awry."); 40 | 41 | // // log_num_buckets_ is the log (base 2) of the number of buckets in the directory: 42 | // const int log_num_buckets_; 43 | 44 | // // directory_mask_ is (1 << log_num_buckets_) - 1. It is precomputed in the contructor 45 | // // for efficiency reasons: 46 | // const uint32_t directory_mask_; 47 | 48 | // Bucket* directory_; 49 | 50 | // HashFamily hasher_; 51 | 52 | // public: 53 | // // Consumes at most (1 << log_heap_space) bytes on the heap: 54 | // explicit SimdBlockFilter(const int log_heap_space); 55 | // SimdBlockFilter(SimdBlockFilter&& that) 56 | // : log_num_buckets_(that.log_num_buckets_), 57 | // directory_mask_(that.directory_mask_), 58 | // directory_(that.directory_), 59 | // hasher_(that.hasher_) {} 60 | // ~SimdBlockFilter() noexcept; 61 | // void Add(const uint64_t key) noexcept; 62 | // bool Find(const uint64_t key) const noexcept; 63 | // uint64_t SizeInBytes() const { return sizeof(Bucket) * (1ull << log_num_buckets_); } 64 | 65 | // private: 66 | // // A helper function for Insert()/Find(). Turns a 32-bit hash into a 256-bit Bucket 67 | // // with 1 single 1-bit set in each 32-bit lane. 68 | // static __m256i MakeMask(const uint32_t hash) noexcept; 69 | 70 | // SimdBlockFilter(const SimdBlockFilter&) = delete; 71 | // void operator=(const SimdBlockFilter&) = delete; 72 | // }; 73 | 74 | // template 75 | // SimdBlockFilter::SimdBlockFilter(const int log_heap_space) 76 | // : // Since log_heap_space is in bytes, we need to convert it to the number of Buckets 77 | // // we will use. 78 | // log_num_buckets_(::std::max(1, log_heap_space - LOG_BUCKET_BYTE_SIZE)), 79 | // // Don't use log_num_buckets_ if it will lead to undefined behavior by a shift that is 80 | // // too large. 81 | // directory_mask_((1ull << ::std::min(63, log_num_buckets_)) - 1), 82 | // directory_(nullptr), 83 | // hasher_() { 84 | // if (!__builtin_cpu_supports("avx2")) { 85 | // throw ::std::runtime_error("SimdBlockFilter does not work without AVX2 instructions"); 86 | // } 87 | // const size_t alloc_size = 1ull << (log_num_buckets_ + LOG_BUCKET_BYTE_SIZE); 88 | // const int malloc_failed = 89 | // posix_memalign(reinterpret_cast(&directory_), 64, alloc_size); 90 | // if (malloc_failed) throw ::std::bad_alloc(); 91 | // memset(directory_, 0, alloc_size); 92 | // } 93 | 94 | // template 95 | // SimdBlockFilter::~SimdBlockFilter() noexcept { 96 | // free(directory_); 97 | // directory_ = nullptr; 98 | // } 99 | 100 | // // The SIMD reinterpret_casts technically violate C++'s strict aliasing rules. However, we 101 | // // compile with -fno-strict-aliasing. 102 | // template 103 | // [[gnu::always_inline]] inline __m256i 104 | // SimdBlockFilter::MakeMask(const uint32_t hash) noexcept { 105 | // const __m256i ones = _mm256_set1_epi32(1); 106 | // // Odd contants for hashing: 107 | // const __m256i rehash = _mm256_setr_epi32(0x47b6137bU, 0x44974d91U, 0x8824ad5bU, 108 | // 0xa2b7289dU, 0x705495c7U, 0x2df1424bU, 0x9efc4947U, 0x5c6bfb31U); 109 | // // Load hash into a YMM register, repeated eight times 110 | // __m256i hash_data = _mm256_set1_epi32(hash); 111 | // // Multiply-shift hashing ala Dietzfelbinger et al.: multiply 'hash' by eight different 112 | // // odd constants, then keep the 5 most significant bits from each product. 113 | // hash_data = _mm256_mullo_epi32(rehash, hash_data); 114 | // hash_data = _mm256_srli_epi32(hash_data, 27); 115 | // // Use these 5 bits to shift a single bit to a location in each 32-bit lane 116 | // return _mm256_sllv_epi32(ones, hash_data); 117 | // } 118 | 119 | // template 120 | // [[gnu::always_inline]] inline void 121 | // SimdBlockFilter::Add(const uint64_t key) noexcept { 122 | // const auto hash = hasher_(key); 123 | // const uint32_t bucket_idx = hash & directory_mask_; 124 | // const __m256i mask = MakeMask(hash >> log_num_buckets_); 125 | // __m256i* const bucket = &reinterpret_cast<__m256i*>(directory_)[bucket_idx]; 126 | // _mm256_store_si256(bucket, _mm256_or_si256(*bucket, mask)); 127 | // } 128 | 129 | // template 130 | // [[gnu::always_inline]] inline bool 131 | // SimdBlockFilter::Find(const uint64_t key) const noexcept { 132 | // const auto hash = hasher_(key); 133 | // const uint32_t bucket_idx = hash & directory_mask_; 134 | // const __m256i mask = MakeMask(hash >> log_num_buckets_); 135 | // const __m256i bucket = reinterpret_cast<__m256i*>(directory_)[bucket_idx]; 136 | // // We should return true if 'bucket' has a one wherever 'mask' does. _mm256_testc_si256 137 | // // takes the negation of its first argument and ands that with its second argument. In 138 | // // our case, the result is zero everywhere iff there is a one in 'bucket' wherever 139 | // // 'mask' is one. testc returns 1 if the result is 0 everywhere and returns 0 otherwise. 140 | // return _mm256_testc_si256(bucket, mask); 141 | // } 142 | -------------------------------------------------------------------------------- /example.cpp: -------------------------------------------------------------------------------- 1 | #include "Tests/wrappers.hpp" 2 | 3 | int main(){ 4 | using spare = TC_shortcut; // Any incremental filter can replace TC_shortcut. 5 | using prefixFilter = Prefix_Filter; // 6 | 7 | size_t filter_max_capacity = 1'000'000; // Choose any size. 8 | prefixFilter example_filter = FilterAPI::ConstructFromAddCount(filter_max_capacity); 9 | 10 | uint64_t x1 = 0x0123'4567'89ab'cdef; 11 | FilterAPI::Add(x1, &example_filter); // Insertions of an item x1. Insertion can be performed only one step at a time. 12 | 13 | bool res = FilterAPI::Contain(x1, &example_filter); // Lookup of x1. 14 | assert(res); //No false negative. 15 | 16 | uint64_t y1 = ~0x0123'4567'89ab'cdef; 17 | bool res2 = FilterAPI::Contain(y1, &example_filter); // Lookup of y1. 18 | std::cout << res2 << std::endl; // Possible false positive. (Although with one item in the filter, this is highly unlikely.) 19 | return 0; 20 | } -------------------------------------------------------------------------------- /main-built.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Tests/smart_tests.hpp" 3 | 4 | void bench_to_csv(); 5 | 6 | int main() { 7 | // constexpr int k1 = (int) ((double) 8 * 0.693147180559945 + 0.5); 8 | // constexpr int k2 = (int) ((double) 12 * 0.693147180559945 + 0.5); 9 | // constexpr int k3 = (int) ((double) 16 * 0.693147180559945 + 0.5); 10 | bench_to_csv(); 11 | return 0; 12 | } 13 | 14 | 15 | void bench_to_csv() { 16 | using CF8 = cuckoofilter::CuckooFilter; 17 | using CF12 = cuckoofilter::CuckooFilter; 18 | using CF16 = cuckoofilter::CuckooFilter; 19 | // using CF32 = cuckoofilter::CuckooFilter; 20 | 21 | using CF8_Flex = cuckoofilter::CuckooFilterStable; 22 | using CF12_Flex = cuckoofilter::CuckooFilterStable; 23 | // using CF16_Flex = cuckoofilter::CuckooFilterStable; 24 | 25 | using inc4 = Prefix_Filter>; 26 | using inc6 = Prefix_Filter; 27 | using inc8 = Prefix_Filter; 28 | // using inc9 = Prefix_Filter>; 29 | 30 | using BBF = SimdBlockFilter<>; 31 | using BBF_Fixed = SimdBlockFilterFixed<>; 32 | 33 | using L_BF8 = bloomfilter::BloomFilter; 34 | using L_BF12 = bloomfilter::BloomFilter; 35 | using L_BF16 = bloomfilter::BloomFilter; 36 | 37 | using CF12_Flex = cuckoofilter::CuckooFilterStable; 38 | using CF16_Flex = cuckoofilter::CuckooFilterStable; 39 | 40 | constexpr size_t number_of_filters = 13; 41 | // constexpr size_t db_speeder = 1; 42 | constexpr size_t max_filter_capacity = ((1ULL << 28) * 94 / 100) / testSmart::db_speeder; 43 | 44 | std::stringstream ss_array[number_of_filters]; 45 | std::string names[14] = {"Bloom-8[k=6]", "Bloom-12[k=8]", "Bloom-16[k=11]", 46 | "CF-8", "CF-12", "CF-8-Flex", "CF-12-Flex","TC", 47 | "PF[BBF_Fixed]", "PF[CF12-Flex]", "PF[TC]", 48 | "BBF", "BBF_Fixed" //"Impala512" 49 | }; 50 | for (size_t j = 0; j < number_of_filters; j++) { 51 | ss_array[j] << names[j] << ", "; 52 | } 53 | 54 | for (size_t i = 0; i < testSmart::ROUNDS; i++) { 55 | vector v_add; 56 | size_t j = 0; 57 | testSmart::fill_vec_smart(&v_add, max_filter_capacity); 58 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 59 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 60 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 61 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 62 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 63 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 64 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 65 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 66 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 67 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 68 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 69 | // ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 70 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 71 | ss_array[j++] << testSmart::bench_build_to_file22(max_filter_capacity, &v_add) << ", "; 72 | // ss_array[j++] << testSmart::bench_build_to_file22>(max_filter_capacity, &v_add) << ", "; 73 | } 74 | 75 | const std::string file_name = "../scripts/build-all.csv"; 76 | std::fstream file(file_name, std::fstream::in | std::fstream::out | std::fstream::app); 77 | file << endl; 78 | file << "n = " << max_filter_capacity << std::endl; 79 | 80 | for (size_t j = 0; j < number_of_filters; j++) { 81 | file << ss_array[j].str() << std::endl; 82 | } 83 | 84 | file.close(); 85 | } 86 | -------------------------------------------------------------------------------- /main-fpp.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "Tests/smart_tests.hpp" 4 | 5 | void write_fpp_to_file(); 6 | 7 | 8 | int main() { 9 | write_fpp_to_file(); 10 | return 0; 11 | } 12 | 13 | void write_fpp_to_file() { 14 | using CF8 = cuckoofilter::CuckooFilter; 15 | using CF12 = cuckoofilter::CuckooFilter; 16 | using CF16 = cuckoofilter::CuckooFilter; 17 | using CF32 = cuckoofilter::CuckooFilter; 18 | using CF8_N2 = cuckoofilter::CuckooFilterStable; 19 | using CF12_Flex = cuckoofilter::CuckooFilterStable; 20 | using CF16_N2 = cuckoofilter::CuckooFilterStable; 21 | using CF32_N2 = cuckoofilter::CuckooFilterStable; 22 | 23 | using inc4 = Prefix_Filter>; 24 | using inc6 = Prefix_Filter; 25 | using inc8 = Prefix_Filter; 26 | using inc9 = Prefix_Filter>; 27 | 28 | using L_BF8 = bloomfilter::BloomFilter; 29 | using L_BF12 = bloomfilter::BloomFilter; 30 | using L_BF16 = bloomfilter::BloomFilter; 31 | 32 | constexpr size_t fp_capacity = ((1ULL << 28) * 94 / 100) / testSmart::db_speeder; 33 | constexpr size_t fp_lookups = fp_capacity; 34 | 35 | std::vector fp_v_add, fp_v_find; 36 | testSmart::fill_vec_smart(&fp_v_add, fp_capacity); 37 | testSmart::fill_vec_smart(&fp_v_find, fp_lookups); 38 | 39 | 40 | std::string path = "../scripts/fpp_table.csv"; 41 | 42 | std::fstream file(path, std::fstream::in | std::fstream::out | std::fstream::app); 43 | file << "n =, " << fp_capacity << ", Lookups =, " << fp_lookups << std::endl; 44 | std::string header = "Filter, Size in bytes, Ratio of yes-queries bits per item (average), optimal bits per item (w.r.t. yes-queries), difference of BPI to optimal BPI, ratio of BPI to optimal BPI"; 45 | // file << "name, byte size, FPR, BPI, opt-BPI, bpi-additive-difference, bpi-ratio" << std::endl; 46 | file << header << std::endl; 47 | file.close(); 48 | 49 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 50 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 51 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 52 | 53 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 54 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 55 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 56 | 57 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 58 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 59 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 60 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 61 | 62 | testSmart::FPR_test>(&fp_v_add, &fp_v_find, path); 63 | testSmart::FPR_test>(&fp_v_add, &fp_v_find, path); 64 | testSmart::FPR_test>(&fp_v_add, &fp_v_find, path); 65 | 66 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 67 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 68 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 69 | 70 | testSmart::FPR_test(&fp_v_add, &fp_v_find, path); 71 | } 72 | -------------------------------------------------------------------------------- /main-perf.cpp: -------------------------------------------------------------------------------- 1 | #include "Tests/smart_tests.hpp" 2 | 3 | void bench_cmp_np(); 4 | void temp_main(); 5 | 6 | int main() { 7 | for (size_t i = 0; i < testSmart::ROUNDS; ++i) { 8 | bench_cmp_np(); 9 | } 10 | return 0; 11 | } 12 | 13 | 14 | void bench_cmp_np() { 15 | // using spare_item = uint64_t; 16 | using CF8 = cuckoofilter::CuckooFilter; 17 | using CF12 = cuckoofilter::CuckooFilter; 18 | using CF16 = cuckoofilter::CuckooFilter; 19 | using CF8_N2 = cuckoofilter::CuckooFilterStable; 20 | using CF12_Flex = cuckoofilter::CuckooFilterStable; 21 | using CF16_Flex = cuckoofilter::CuckooFilterStable; 22 | 23 | 24 | using inc4 = Prefix_Filter>; 25 | using inc6 = Prefix_Filter; 26 | using inc8 = Prefix_Filter; 27 | // using inc9 = Prefix_Filter>; 28 | 29 | using L_BF8 = bloomfilter::BloomFilter; 30 | using L_BF12 = bloomfilter::BloomFilter; 31 | using L_BF16 = bloomfilter::BloomFilter; 32 | 33 | // constexpr size_t db_speeder = 1; 34 | constexpr size_t max_filter_capacity = ((1ULL << 28) * 94 / 100) / testSmart::db_speeder;// load is .94 35 | constexpr size_t lookup_reps = max_filter_capacity; 36 | constexpr size_t bench_precision = 20; 37 | std::vector v_add, v_find; 38 | 39 | testSmart::fill_vec_smart(&v_add, max_filter_capacity); 40 | testSmart::fill_vec_smart(&v_find, lookup_reps); 41 | 42 | 43 | const std::string path = "../scripts/Inputs/"; 44 | 45 | constexpr bool to_print = false; 46 | 47 | testSmart::Bench_res_to_file_incremental_22>(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 48 | testSmart::Bench_res_to_file_incremental_22>(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 49 | // testSmart::Bench_res_to_file_incremental_22>(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 50 | 51 | testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 52 | testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 53 | testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 54 | testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 55 | 56 | // testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 57 | testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 58 | testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 59 | testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 60 | // testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 61 | 62 | // testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 63 | // testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 64 | // testSmart::Bench_res_to_file_incremental_22(max_filter_capacity, bench_precision, &v_add, &v_find, path, to_print); 65 | return; 66 | } 67 | 68 | -------------------------------------------------------------------------------- /scripts/Naming.py: -------------------------------------------------------------------------------- 1 | from typing import * 2 | from datetime import datetime 3 | 4 | def get_marker_type(filter_name: str) -> str: 5 | filter_name = filter_name.strip() 6 | prefix_names_list = ["PF", "CF", "TC", "Bloom", "BBF", "Lem", "Impala512", "BF"] 7 | symbols = ["o", "s", "D", "D", "^", "X", '$\star$', "D"] 8 | default_symbol = "o" 9 | for i in range(len(prefix_names_list)): 10 | temp_prefix = prefix_names_list[i] 11 | if filter_name.startswith(temp_prefix): 12 | return symbols[i] 13 | 14 | return default_symbol 15 | 16 | 17 | def name_dict(filter_name: str) -> str: 18 | filter_name = filter_name.strip() 19 | name_dict = { 20 | 'BBF-Fixed': "BBF-Flex", 21 | 'BBF_Fixed': "BBF-Flex", 22 | 'Cuckoo-8': 'CF-8', 23 | 'Cuckoo-12': 'CF-12', 24 | 'Cuckoo-16': 'CF-16', 25 | 'CuckooStable-8': 'CF-8-Flex', 26 | 'CuckooStable-12': 'CF-12-Flex', 27 | 'CuckooStable-16': 'CF-16-Flex', 28 | 'SimdBlockFilter': "BBF", 29 | 'TCD256': "TwoChoicer-256", 30 | 'TC_V2': "TwoChoicer", 31 | 'TC-shortcut': "TC", 32 | 'TwoChoicer-dynamic': "TC-dyn", 33 | 'VQF_Wrapper': "VQF", 34 | 'inc2Choicer': "TwoChoicer", 35 | 'Prefix-Filter [ evenFilter ]': "PF[AF-2]", 36 | 'PF[BBF_Fixed]': "PF[BBF-Flex]", 37 | 'PF[BBF-Fixed]': "PF[BBF-Flex]", 38 | 'Prefix-Filter [ SimdBlockFilter ]': "PF[BBF]", 39 | 'Prefix-Filter [ Cuckoo-12 ]': 'PF[CF-12]', 40 | 'Prefix-Filter [ CuckooStable-12 ]': 'PF[CF-12-Flex]', 41 | 'PF[CF12-Flex]': 'PF[CF-12-Flex]', 42 | 'Prefix-Filter [ TC-shortcut ]': 'PF[TC]', 43 | 'Prefix-Filter [ BBF-Fixed ]': 'PF[BBF-Flex]', 44 | 'Prefix-Filter [ Impala512 ]': 'PF[Impala]', 45 | 'Bloom-8[k=6]': 'BF-8[k=6]', 46 | 'Bloom-12[k=8]': 'BF-12[k=8]', 47 | 'Bloom-16[k=11]': 'BF-16[k=11]', 48 | 'Bloom-16[k=10]': 'BF-16[k=11]' 49 | } 50 | 51 | if filter_name in name_dict: 52 | return name_dict[filter_name] 53 | else: 54 | print(filter_name, "not in dict") 55 | return filter_name 56 | 57 | 58 | def get_time(): 59 | return datetime.now().strftime('%Y-%m-%d %H:%M:%S') 60 | -------------------------------------------------------------------------------- /scripts/__pycache__/Naming.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TomerEven/Prefix-Filter/f6efa59bd84365f301014c6eb40161cb21054b69/scripts/__pycache__/Naming.cpython-38.pyc -------------------------------------------------------------------------------- /scripts/build-csv-parser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from typing import * 4 | import matplotlib.pyplot as plt 5 | import pandas as pd 6 | 7 | import os 8 | from matplotlib import cm 9 | import numpy as np 10 | from statistics import median 11 | from Naming import name_dict, get_time 12 | 13 | Def_COLOR = cm.inferno_r(np.linspace(.4, .8, 30)) 14 | 15 | dummy = [] 16 | dummy_names = [] 17 | dummy_tuple_list = [] 18 | 19 | 20 | def built_plot_bar(filters_names: List[str], built_time_list_ns: List[int], divisor, units=1e9): 21 | # print("Here!") 22 | built_time = [i / units for i in built_time_list_ns] 23 | filters_names = [name_dict(t.strip()) for t in filters_names] 24 | 25 | tuples_list = [(built_time[_], filters_names[_]) 26 | for _ in range(len(built_time))] 27 | tuples_list.sort() 28 | dummy_tuple_list.append(tuples_list) 29 | s_BT = [i[0] for i in tuples_list] 30 | s_names = [i[1] for i in tuples_list] 31 | 32 | line = "{:30}:\t{:.7f}" 33 | for i in tuples_list: 34 | print(line.format(i[1], i[0])) 35 | 36 | s = pd.Series( 37 | s_BT, 38 | index=s_names, 39 | # Title = "tomer" 40 | ) 41 | factor = 100 42 | # temp_color = cm.inferno_r(np.linspace(0.1, .7, len(filters_names) + 2)) 43 | # temp_color = cm.RdYlGn(np.linspace(0, 1, len(filters_names) + 2))[::-1] 44 | # color_plate = cm.RdYlGn(np.linspace(0, 1, factor + 1))[::-1] 45 | color_plate = cm.RdYlGn(np.linspace(0.2, 0.8, factor + 1))[::-1] 46 | 47 | def get_index_in_range(x): 48 | r_min, r_max = min(built_time), max(built_time) 49 | assert r_min <= x <= r_max 50 | shifted = x - r_min 51 | normalized = shifted / (r_max - r_min) 52 | index = round(normalized*factor) 53 | assert index <= factor 54 | return index 55 | 56 | color_indexes = [get_index_in_range(i[0]) for i in tuples_list] 57 | final_colors = [color_plate[i] for i in color_indexes] 58 | s.plot( 59 | kind='bar', 60 | stacked=True, 61 | color=final_colors, 62 | # ylabel = "Seconds" 63 | # title="Built Time", 64 | 65 | # colormap='Paired', 66 | ) 67 | plt.grid(which="major", linestyle='--', linewidth=.8, axis='y') 68 | plt.grid(which="minor", linestyle='-', linewidth=.4, axis='y') 69 | # plt.set_title("Built Time", fontsize = 18) 70 | plt.minorticks_on() 71 | plt.ylabel("Seconds", fontsize=14) 72 | # plt.yticks() 73 | # s.set_axis() 74 | pic_dir = "Built-time-median-({:}).pdf".format(get_time()) 75 | plt.savefig(pic_dir, format="pdf", bbox_inches='tight') 76 | # plt.show() 77 | plt.clf() 78 | 79 | 80 | def get_lines(file_name: str) -> list: 81 | # file_name = os.path.basename(dir) 82 | # RunAll_path = os.getcwd() 83 | # main_path = os.path.dirname(RunAll_path) 84 | # path = os.path.join(main_path, "scripts") 85 | # path = os.path.join(path, file_name) 86 | f = open(file_name, "r") 87 | lines = f.readlines() 88 | f.close() 89 | return lines 90 | 91 | 92 | def process_list_of_files(csv_file: list): 93 | lines = get_lines(csv_file) 94 | first_line = 0 95 | for i in range(-1, -len(lines) - 1, -1): 96 | if lines[i].startswith("n ="): 97 | first_line = i 98 | break 99 | assert first_line != 0 100 | lines = lines[first_line:] 101 | div = int(lines[0].split("=")[1]) 102 | values_list = [] 103 | names_list = [] 104 | for line in lines[1:]: 105 | split_l = line.split(",") 106 | names_list.append(split_l[0]) 107 | temp = [int(i) for i in split_l[1:-1]] 108 | values_list.append(temp) 109 | 110 | built_time_ns_list = [] 111 | for i in values_list: 112 | temp_built = median(i) 113 | built_time_ns_list.append(temp_built) 114 | 115 | filter_max_cap = div 116 | 117 | built_plot_bar(names_list, built_time_ns_list, filter_max_cap) 118 | 119 | 120 | def get_paths_from_base_names(base_names: List[str]): 121 | return [os.path.join("Built-Inputs", i) for i in base_names] 122 | 123 | 124 | def main(): 125 | filename_list = [i for i in os.listdir("../scripts/") if i.startswith("build-all") and i.endswith(".csv")] 126 | #print("filename_list:",filename_list) 127 | assert len(filename_list) == 1 128 | filename = filename_list[0] 129 | path = os.path.join("../scripts/", filename) 130 | process_list_of_files(path) 131 | 132 | 133 | main() 134 | -------------------------------------------------------------------------------- /scripts/fpp-parser-server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # from typing import * 4 | # import matplotlib.pyplot as plt 5 | # import numpy as np 6 | import os 7 | from typing import * 8 | import matplotlib.pyplot as plt 9 | import matplotlib 10 | import pandas as pd 11 | import time 12 | import os 13 | 14 | import numpy as np 15 | 16 | 17 | headers = ["Filter", "Size in bytes", "Ratio of yes-queries", 18 | "bits per item (average)", "optimal bits per item (w.r.t. yes-queries)", 19 | "difference of BPI to optimal BPI", "ratio of BPI to optimal BPI"] 20 | 21 | headers2 = ["Filter", "Size in bytes", "yes-queries ratio", 22 | "BPI (average)", "opt BPI", 23 | "Difference", "Ratio"] 24 | 25 | headers3 = ["Filter", "bytes size", "PR ratio", 26 | " BPI", "opt BPI", "Difference", " Ratio"] 27 | 28 | 29 | def get_lines(path: str) -> list: 30 | # file_name = os.path.basename(dir) 31 | f = open(path, "r") 32 | lines = f.readlines() 33 | f.close() 34 | return lines 35 | 36 | 37 | def parse_line(line: str) -> list: 38 | assert len(line) 39 | assert not line.startswith("#") 40 | # print(line) 41 | 42 | temp_data = line.split(",") 43 | temp_data1 = [i.strip() for i in temp_data] 44 | 45 | fl = [] 46 | fl += [temp_data1[0], int(temp_data1[1])] 47 | fl += [float(i) for i in temp_data1[2:]] 48 | assert (len(fl) == len(headers)) 49 | return fl 50 | 51 | 52 | def beauty_table(my_table): 53 | names = ['CF-8', 54 | 'CF-8-Flex', 55 | 'CF-12', 56 | 'CF-12-Flex', 57 | 'CF-16', 58 | 'CF-16-Flex', 59 | '\\midrule', 60 | 'PF[CF-12-Flex]', 61 | 'PF[TC]', 62 | 'PF[Impala512]', 63 | '\\midrule', 64 | 'BBF', 65 | 'BBF-Flex', 66 | 'Impala512', 67 | 'Bloom-8[k=6]', 68 | 'Bloom-12[k=8]', 69 | 'Bloom-16[k=10]', 70 | '\\midrule', 71 | 'TC'] 72 | 73 | size = len(my_table) 74 | assert size >= len(names) - 3 75 | offset = 0 76 | 77 | for i in range(size): 78 | if names[i + offset] == '\\midrule': 79 | print("\\midrule") 80 | offset += 1 81 | 82 | if names[i + offset] != my_table[i][0].strip(): 83 | print(names[i + offset], my_table[i][0].strip()) 84 | assert 0 85 | 86 | line = "{:}\t & {:<.4f} & {:<.2f} & {:<.2f}& {:<.2f} & {:<.3f} \\\\" 87 | arg = names[i + offset], my_table[i][2]*100, *my_table[i][3:] 88 | print(line.format(*arg)) 89 | 90 | 91 | def main(path): 92 | lines = get_lines(path) 93 | table = [] 94 | for line in lines: 95 | line = line.strip() 96 | to_skip = (len(line) == 0) or (line.startswith("#")) 97 | if to_skip: 98 | continue 99 | temp_fl = parse_line(line) 100 | table.append(temp_fl) 101 | 102 | beauty_table(table) 103 | return table 104 | 105 | 106 | path = os.path.join(os.getcwd(), "fpp-pseudo.csv") 107 | # path = "scripts/fpp-pseudo.csv" 108 | res = main(path) 109 | --------------------------------------------------------------------------------