Improving performance of JNA by using LLVM JIT compiler

Java Native Access (JNA) has been proposed to alleviate the burden of programming in Java Native Interface (JNI). JNA allows programmer to call native functions without writing any JNI codes. However, JNA suffers from some performance degradation. To overcome this problem, in this paper, we modify the JNA source code and integrate the LLVM JIT compiler into JNA to improve the performance. Our experiment achieves about 8% to 16% performance improvement for calling a native function with different types and numbers of arguments. Furthermore, our design is a non-traditional way of using the runtime compiler, and the challenges we encountered may help other researchers to face the similar situations.

[1]  Kishori Sharan Java Native Interface , 2014 .

[2]  Angela Demke Brown,et al.  Inlining java native calls at runtime , 2005, VEE '05.

[3]  Qi Zhang,et al.  Java JNI Bridge: a framework for mixed native ISA execution , 2006, International Symposium on Code Generation and Optimization (CGO'06).

[4]  Robert Grimm,et al.  Jeannie: granting java native interface developers their wishes , 2007, OOPSLA.

[5]  Goh Kondoh,et al.  Finding bugs in java native interface programs , 2008, ISSTA '08.

[6]  Bo Li,et al.  Efficient Java Native Interface for Android Based Mobile Devices , 2011, 2011IEEE 10th International Conference on Trust, Security and Privacy in Computing and Communications.

[7]  Sheng Liang,et al.  Java Native Interface: Programmer's Guide and Specification , 1999 .

[8]  Dawid Kurzyniec,et al.  Efficient Cooperation between Java and Native Codes – JNI Performance Benchmark , 2001 .

[9]  Matthias Jacob,et al.  Performance Issues for Multi-language Java Applications , 2000, IPDPS Workshops.

[10]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[11]  Troy Downing,et al.  Java Virtual Machine , 1997 .