简体   繁体   中英

What is the most efficient way to access java methods from c++

Clearly one could use the java JNI, but would accessing the methods through web services be potentially faster?

The methods that concern me the most are the iterative methods, where objects in an array are serially accessed. In C++ the loop is:

for (int i = 0; i < n; ++)
    get ith object from java // JNI or web service call?

Clearly one should use JNI if you're on the same host. Web services are going to have client/server socket overhead that's not needed in this case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM