Skip to content

Commit 42dbf00

Browse files
committed
saving.
1 parent 8bd9c89 commit 42dbf00

3 files changed

Lines changed: 57 additions & 13 deletions

File tree

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ The library includes a performance analysis tool that measures:
104104
To run the performance analysis:
105105

106106
```bash
107-
mvn exec:java -Dexec.mainClass="me.lemire.xfuse.Statistics" -q
107+
mvn process-classes exec:exec@run-statistics -q
108108
```
109109

110110
## Bits per element (bits/element)
@@ -133,8 +133,7 @@ The library includes JMH (Java Microbenchmark Harness) benchmarks for accurate p
133133
To run the benchmarks:
134134

135135
```bash
136-
mvn clean compile exec:exec@compile-native
137-
java --enable-native-access=ALL-UNNAMED -cp target/classes:$(mvn dependency:build-classpath -q -Dmdep.outputFile=/dev/stdout) me.lemire.xfuse.FilterBenchmark
136+
mvn initialize exec:exec@run-benchmark
138137
```
139138

140139
This runs benchmarks for BinaryFuse8 filter with 1,000,000 elements, measuring:
@@ -144,11 +143,11 @@ This runs benchmarks for BinaryFuse8 filter with 1,000,000 elements, measuring:
144143

145144
Example JMH output:
146145
```
147-
Benchmark Mode Cnt Score Error Units
148-
FilterBenchmark.benchmarkContainsExistingThroughput thrpt 5 44038254,445 ± 1339377,802 ops/s
149-
FilterBenchmark.benchmarkContainsNonExistingThroughput thrpt 5 43633598,029 ± 239529,108 ops/s
150-
FilterBenchmark.benchmarkContainsExisting avgt 5 23,013 ± 0,629 ns/op
151-
FilterBenchmark.benchmarkContainsNonExisting avgt 5 22,715 ± 1,545 ns/op
146+
Benchmark Mode Cnt Score Error Units
147+
FilterBenchmark.benchmarkContainsExistingThroughput thrpt 5 50484381,496 ± 609123,975 ops/s
148+
FilterBenchmark.benchmarkContainsNonExistingThroughput thrpt 5 51331184,332 ± 771448,745 ops/s
149+
FilterBenchmark.benchmarkContainsExisting avgt 5 19,589 ± 1,489 ns/op
150+
FilterBenchmark.benchmarkContainsNonExisting avgt 5 19,607 ± 0,469 ns/op
152151
```
153152

154153
How to interpret this data:

pom.xml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
<groupId>org.codehaus.mojo</groupId>
6464
<artifactId>exec-maven-plugin</artifactId>
6565
<version>3.1.0</version>
66+
<configuration>
67+
<includeProjectDependencies>true</includeProjectDependencies>
68+
</configuration>
6669
<executions>
6770
<execution>
6871
<id>compile-native</id>
@@ -93,14 +96,52 @@
9396
<argument>--enable-native-access=ALL-UNNAMED</argument>
9497
<argument>-Djava.library.path=${project.build.directory}/classes</argument>
9598
<argument>-cp</argument>
96-
<argument>${project.build.directory}/classes:${maven.dependency.classpath}</argument>
99+
<argument>${maven.dependency.classpath}:${project.build.directory}/classes</argument>
100+
<argument>org.openjdk.jmh.Main</argument>
101+
<argument>-f</argument>
102+
<argument>0</argument>
97103
<argument>me.lemire.xfuse.FilterBenchmark</argument>
98104
</arguments>
99105
</configuration>
100106
</execution>
107+
<execution>
108+
<id>run-statistics</id>
109+
<phase>none</phase>
110+
<goals>
111+
<goal>exec</goal>
112+
</goals>
113+
<configuration>
114+
<executable>java</executable>
115+
<arguments>
116+
<argument>--enable-native-access=ALL-UNNAMED</argument>
117+
<argument>-Djava.library.path=${project.build.directory}/classes</argument>
118+
<argument>-cp</argument>
119+
<argument>${maven.dependency.classpath}:${project.build.directory}/classes</argument>
120+
<argument>me.lemire.xfuse.Statistics</argument>
121+
</arguments>
122+
</configuration>
123+
</execution>
101124
</executions>
102125
</plugin>
103126
<!-- JMH plugin not available, using manual benchmark -->
127+
<plugin>
128+
<groupId>org.apache.maven.plugins</groupId>
129+
<artifactId>maven-dependency-plugin</artifactId>
130+
<version>3.6.0</version>
131+
<executions>
132+
<execution>
133+
<id>build-classpath</id>
134+
<phase>initialize</phase>
135+
<goals>
136+
<goal>build-classpath</goal>
137+
</goals>
138+
<configuration>
139+
<outputProperty>maven.dependency.classpath</outputProperty>
140+
<scope>runtime</scope>
141+
</configuration>
142+
</execution>
143+
</executions>
144+
</plugin>
104145
<plugin>
105146
<groupId>org.apache.maven.plugins</groupId>
106147
<artifactId>maven-surefire-plugin</artifactId>

src/main/java/me/lemire/xfuse/XorFilter.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ public interface XorFilterInterface extends AutoCloseable {
186186
);
187187
xor8_contain = linker.downcallHandle(
188188
lookup.find("xfuse_xor8_contain").orElseThrow(),
189-
xor8_contain_desc
189+
xor8_contain_desc,
190+
Linker.Option.critical(false)
190191
);
191192
xor8_free = linker.downcallHandle(
192193
lookup.find("xfuse_xor8_free").orElseThrow(),
@@ -206,7 +207,8 @@ public interface XorFilterInterface extends AutoCloseable {
206207
);
207208
binary_fuse16_contain = linker.downcallHandle(
208209
lookup.find("xfuse_binary_fuse16_contain").orElseThrow(),
209-
binary_fuse16_contain_desc
210+
binary_fuse16_contain_desc,
211+
Linker.Option.critical(false)
210212
);
211213
binary_fuse16_free = linker.downcallHandle(
212214
lookup.find("xfuse_binary_fuse16_free").orElseThrow(),
@@ -226,7 +228,8 @@ public interface XorFilterInterface extends AutoCloseable {
226228
);
227229
xor16_contain = linker.downcallHandle(
228230
lookup.find("xfuse_xor16_contain").orElseThrow(),
229-
xor16_contain_desc
231+
xor16_contain_desc,
232+
Linker.Option.critical(false)
230233
);
231234
xor16_free = linker.downcallHandle(
232235
lookup.find("xfuse_xor16_free").orElseThrow(),
@@ -246,7 +249,8 @@ public interface XorFilterInterface extends AutoCloseable {
246249
);
247250
binary_fuse8_contain = linker.downcallHandle(
248251
lookup.find("xfuse_binary_fuse8_contain").orElseThrow(),
249-
binary_fuse8_contain_desc
252+
binary_fuse8_contain_desc,
253+
Linker.Option.critical(false)
250254
);
251255
binary_fuse8_free = linker.downcallHandle(
252256
lookup.find("xfuse_binary_fuse8_free").orElseThrow(),

0 commit comments

Comments
 (0)