I have a C++ program and a Java program. On the C++ side, I have a vector having millions of entries. I need to transfer this data to my Java program. So far, I have tried the following:
Created a unix socket, converted the vector to a long string (Serialized) and send it through the unix socket
Created a thrift server/client model to transfer the data
Both approaches worked very well, but the performance I'm getting is quite low. I don't even see it using the full network bandwidth (in the case of thrift).
Also with the unix socket approach, Since I'm serializing it to String and then again converting this string back to a string array (received byte[] to String and split) on the Java side is very expensive operation.
What is the best way to transfer data faster from the C++ world to the Java world with lesser overhead on reconstructing/serializing the object?