A quick jni4net performance hack
jni4net is a great library that creates Java proxies for Microsoft based C# libraries on the Windows platform. It makes Java JNI easy with good performance. You follow this processes to use jni4net Create your C# library Run proxygen to generate Java native library source code and C# adapter source that shims in between Java and the original library. Run javac to compile the java code Create a jar file of the compiled java code Run the .Net csc.exe that comes with the default .Net installation to compile the C# code Create a new DLL of the just compiled C# code Create a Java program that uses the new generated Jar file, the generated C# dll and the original C# dll. I found a quick hack that improves the performance of the jni4net bridge that involves inserting a line of code in each generate C# method. This hack improves the Java-to-DLL call time only. It does not impact the performance of the Java code on one side or the C# code on the other. It lowers th...