Login  Register

Re: Negating some JNI call overhead by doing transformations in Java

Posted by Michael Bien on Jul 21, 2011; 1:54pm
URL: https://forum.jogamp.org/Negating-some-JNI-call-overhead-by-doing-transformations-in-Java-tp3188212p3188571.html

  4 mil JNI calls/s are not much. but who knows what the driver does if
you ask him for the version (maybe it gets parsed from the readme file
or so :P )

the last time i checked the average JNI call took between 11 and 15ns,
benchmarked on ubuntu/i7/64bit server VM. The overhead was largely
independent of the argument count (compared to JNA). But in practice a
JNI function isn't empty...

one reason for example why JOCL allows in the runtime API only direct
allocated buffers is simplified binding code to reduce call overhead to
a minimum.

On 07/21/2011 03:29 PM, Wade Walker [via jogamp] wrote:
> I benchmarked JNI call rate a while back when someone asked me about this on
> my blog (benchmark code at
> http://wadeawalker.wordpress.com/2010/10/17/tutorial-faster-rendering-with-vertex-buffer-objects/#comment-108).
> The result was I could make anywhere from ~300,000 to ~4,000,000 JNI calls
> per second on a 2.4GHz machine, depending on the amount of loop unrolling
> performed by the JVM. I didn't test to see how much was "extra" due to JNI
> (compared to just a normal Java call).
>