Our problem is that JNI is a large overhead and we cannot reduce it. We have tried a number of different ways of moving data from the VM to native code, and here we present benchmarks for these techniques. What we recommend is a minor extension to JNI for lightweight calls. To cut to the chase, here are the benchmarks. Each chart is a comparison of different techniques to move data from Java to native code for a given JVM on different platforms.
Bigger bars are better because the benchmark is throughput.
The row contains 50 integers and 50 byte arrays. These are included in the benchmark as reference points. JavaRowConsumer implements the benchmark task in pure Java by storing the row in Java variables. SocketRowConsumer does not use JNI either, but instead moves data across a socket to a TCP server that just consumes all the data it is sent. This solution is not efficient and came last in all our tests.