|
1 | | -# XorFilter Java Library |
| 1 | +# The jfusebin Java Library |
2 | 2 |
|
3 | | -A Java library that provides access to high-performance XOR filters using Java's Foreign Function & Memory (FFM) API. |
| 3 | +A Java library that provides access to high-performance XOR and Binary Fuse filters using Java's Foreign Function & Memory (FFM) API. |
4 | 4 |
|
5 | 5 | ## Overview |
6 | 6 |
|
7 | | -This library wraps the [xorfilter](https://github.com/FastFilter/xorfilter) C library, providing Java bindings for probabilistic data structures that can efficiently test set membership with low false positive rates. |
| 7 | +This library wraps a C library, providing Java bindings for probabilistic data structures that can efficiently test set membership with low false positive rates. |
8 | 8 |
|
9 | 9 | ## Features |
10 | 10 |
|
11 | | -- **Xor8 Filter**: ~0.3% false positive rate, 8 bits per key |
12 | | -- **Xor16 Filter**: Lower false positive rate, 16 bits per key |
13 | | -- **Binary Fuse8 Filter**: Alternative implementation with different performance characteristics |
14 | | -- Uses Java 21's incubator FFM API for direct native calls |
15 | | -- Memory-efficient and high-performance |
| 11 | + |
| 12 | +- **Xor8 Filter**, - **Binary Fuse8 Filter**: 0.39% false positive rate, slightly over 8 bits per key, for larger inputs, the Binary Fuse8 Filter is smaller and faster |
| 13 | +- **Xor16 Filter**, - **Binary Fuse16 Filter**: 0.0015% false positive rate, slightly over 16 bits per key, for larger inputs, the Binary Fuse16 Filter is smaller and faster |
| 14 | + |
16 | 15 |
|
17 | 16 | ## Requirements |
18 | 17 |
|
19 | 18 | - Java 22+ |
20 | | -- GCC or compatible C compiler |
21 | | -- macOS/Linux (Windows support would require additional configuration) |
| 19 | +- GCC, LLVM or compatible C compiler |
22 | 20 |
|
23 | 21 | ## Building |
24 | 22 |
|
25 | 23 | 1. Clone this repository |
26 | 24 | 2. Run Maven to build: |
27 | 25 |
|
28 | 26 | ```bash |
29 | | -mvn clean compile |
30 | | -mvn exec:exec@compile-native |
| 27 | +mvn clean compile exec:exec@compile-native |
31 | 28 | ``` |
32 | 29 |
|
33 | | -This will: |
34 | | -- Compile the Java classes with JMH annotation processing |
35 | | -- Compile the native C wrapper library |
36 | | -- Place the native library in `target/classes/` |
37 | 30 |
|
38 | | -Or build everything at once: |
39 | 31 |
|
40 | | -```bash |
41 | | -mvn clean compile |
42 | | -``` |
43 | 32 |
|
44 | 33 | ## Usage |
45 | 34 |
|
@@ -114,9 +103,3 @@ Key results: |
114 | 103 | - **Java Layer**: FFM API bindings that manage memory and call native functions |
115 | 104 | - **Resource Management**: Uses ResourceScope for automatic memory management |
116 | 105 |
|
117 | | -## Performance |
118 | | - |
119 | | -The filters provide: |
120 | | -- Fast construction and lookup |
121 | | -- Low memory overhead (~8-16 bits per key) |
122 | | -- Configurable false positive rates |
0 commit comments