Skip to content

Demo for java ffi, attach for article of 恒生技术

License

Notifications You must be signed in to change notification settings

abomb4/demo-java-ffi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

demo-java-ffi

Demo for java ffi, attach for article of 恒生技术.

To run this demo, you need JDK 20 installed.

This demo contains JNI, JNA, JNI, Panama example projects, those java project are using a C library in libffidemo. There is 4 methods in libffidemo includes simple sum method, simple string method, simple struct method and an array of structs returning method.

I've tested performance of each FFI mechanism on my i5-8225U computer, the result is:

FFI TPS
JNI 180000
JNA 66000
JNR 270000
Panama 420000

Panama is awesome, but it hasn't released, sad.

About

Demo for java ffi, attach for article of 恒生技术

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published