Use JNI instead of JNA to call native code?

后端 未结 10 2110
滥情空心
滥情空心 2020-11-28 18:42

JNA seems a fair bit easier to use to call native code compared to JNI. In what cases would you use JNI over JNA?

10条回答
  •  伪装坚强ぢ
    2020-11-28 19:01

    I investigated JNI and JNA for performance comparison because we needed to decide one of them to call a dll in project and we had a real time constraint. The results have showed that JNI has greater performance than JNA(approximately 40 times). Maybe there is a trick for better performance in JNA but it is very slow for a simple example.

提交回复
热议问题