What is the cost of Java's native methods?

75 views Asked by At

Recently, when I was reading some article (do not ask me to remember it's title), I found out that improving performance with Java's native methods is not such a good idea, as switching state of thread, converting Java's variables and classes into C's variables and other necessary operations do also take some time to execute method.

But, what it the exact time per variable conversation and wouldn't it be better to use ProcessBuilder?

Which is faster:

try{
    new ProcessBuilder("pseudo-method name","and","other","parameters").start();
}catch(IOEcxeption ex){}

or

nativeMethod();

?
And what is the precise time of executing them (considering application and method are both empty)?

0

There are 0 answers