Add jextract module: SQLite bindings generated with jextract, FFM arenas, C strings, out-parameters, errors, upcalls, and a JMH comparison with JNI
jextract-25 early-access build (25-jextract+2-4) on JDK 25.0.5+8 against SQLite 3.45.1: 25 functions and 13 constants generated into 4 committed files (the whole header would be 83 files), a small Db wrapper, the four arena kinds used wrongly on purpose, ADDRESS vs C_POINTER zero-length vs unbounded segments and the SIGSEGV from getString on a NULL pointer, sqlite3_open out-parameter, return codes to exceptions, a sqlite3_exec upcall and the VM exit when it throws, the JDK 25 native-access warning and --illegal-native-access=deny, library loading failures, and a JMH benchmark of FFM vs hand-written JNI vs plain Java (indicative only: shared 2-CPU machine). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6Kg9RWSTJzyz6KP9X
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
$ java --enable-native-access=ALL-UNNAMED -Djava.library.path=build/lib org.openjdk.jmh.Main -f 5 -wi 3 -w 1 -i 5 -r 1 (25.0.5+8-LTS, JMH 1.37)
|
||||
machine: 2 CPUs, Intel(R) Xeon(R) Processor @ 2.10GHz
|
||||
load average before the run: 4.00 4.80 2.92 (1, 5, 15 minutes; this box has 2 CPUs and was shared with other jobs)
|
||||
sqlite: libsqlite3-dev 3.45.1-1ubuntu2.8
|
||||
Benchmark Mode Cnt Score Error Units
|
||||
SqliteBench.insert1000_ffm avgt 25 653368.858 ± 161095.825 ns/op
|
||||
SqliteBench.insert1000_jni avgt 25 544963.964 ± 97090.203 ns/op
|
||||
SqliteBench.strlike_ffm_arenaPerCall avgt 25 192.233 ± 62.055 ns/op
|
||||
SqliteBench.strlike_ffm_preallocated avgt 25 82.660 ± 16.253 ns/op
|
||||
SqliteBench.strlike_jni avgt 25 244.929 ± 82.330 ns/op
|
||||
SqliteBench.versionNumber_ffm avgt 25 16.819 ± 4.063 ns/op
|
||||
SqliteBench.versionNumber_jni avgt 25 14.054 ± 4.949 ns/op
|
||||
SqliteBench.versionNumber_plainJava avgt 25 0.651 ± 0.162 ns/op
|
||||
load average after the run: 5.97 6.05 4.10
|
||||
Reference in New Issue
Block a user