|
Replies:
2
-
Last Post:
Nov 28, 2008 3:15 PM
by: linuxhippy
|
Threads:
[
Previous
|
Next
]
|
|
|
|
|
|
Whats going on at a JNI call?
Posted:
Jul 18, 2008 5:14 AM
|
|
|
Hi there,
I did some benchmarking of JNI calls on x86 and I would be really interested whats going on when a native method is called.
On my C2D I see about 35cycles call-overhead ... I would be really curious what is goind on at a JNI call, which instructions are used and what they are actually doing.
Has anybody had a look at the instructions generated by hotspot?
Thank you in advance, lg Clemens
|
|
|
|
|
|
|
Re: Whats going on at a JNI call?
Posted:
Nov 27, 2008 12:34 AM
in response to: linuxhippy
|
|
|
Hi,
How did you measure this and what version of JDK did you use and what platform?
After all, 35 cycles per call is not that bad. I believe that the main overheads are arguments marshaling and checks on the rerun path (safepoint check).
Thanks,
Ivan
|
|
|
|
|
|
|
|
Re: Whats going on at a JNI call?
Posted:
Nov 28, 2008 3:15 PM
in response to: ikrylov
|
|
|
It was with hotspot server, I figured it out by simply benchmarking it on a Core2Duo. Well an additional argument adds about 1-2 cycles, I guess the safepoint-checking also costs about 2-3 cycles.
The native method only incremented an integer, so maybe 5-6 cycles.
I would be interested what else is going on 
- Clemens
|
|
|
|
|