Search code examples
javacnetwork-programmingjava-native-interfaceudp

Java vs C JNI - UDP performance


I am currently writing a Java client to communicate to a server using UDP.

If one wanted pure UDP performance with packet throughput, would there be any advantage to writing the UDP networking communication in C and passing the data to it from java via JNI. Or would the overhead of JNI remove any performance gained by sending the packets in C?]

Thanks


Solution

  • The overhead of the network would dominate any possible difference. The extra complication of JNI and the immense extra complication of writing networking code in C just isn't worth it. Forget it.