FastFilter / fastfilter_java

Fast Approximate Membership Filters (Java)
Apache License 2.0
238 stars 27 forks source link

The arrayLength in Xor8 and Xor16 #36

Closed Zzfiv3 closed 1 year ago

Zzfiv3 commented 1 year ago

Hi, I notice that the arrayLength in Xor8 and Xor16 are written as:

int arrayLength = getArrayLength(size);
private static int getArrayLength(int size) { return (int) (HASHES + (long) FACTOR_TIMES_100 * size / 100); }

However, in the paper, Xor Filters: Faster and Smaller Than Bloom and Cuckoo Filters, the size of the array $c$ should be $$ c = \lfloor 1.23 \cdot |S| \rfloor + 32 $$

I think maybe change the getArrayLength method to { return (int) (32 + (long) FACTOR_TIMES_100 * size / 100); } could work

Zzfiv3 commented 1 year ago

Sorry, I have downloaded the previous version before. The latest version is correct. ^^