> -----Original Message-----
> From: Pier Fumagalli [mailto:[EMAIL PROTECTED]] 
> Sent: 13. lipanj 2002 19:35
> To: Tomcat Developers List
> Cc: [EMAIL PROTECTED]
> Subject: Re: Performance of JNI calls
> 
> 
> "Mladen Turk" <[EMAIL PROTECTED]> wrote:
> 
> > The most important thing that bothers me is that the java 
> is more then 
> > 2 times slower then the GetByteArrayRegion version. Now, I allway 
> > tought that JNI calls imposes serious performance 
> degradation, but I'm 
> > not so sure now.
> 
> That was JDK 1.2... We've gone a long way... It mostly 
> depends on what VM you're trying it out...
> 
>     Pier

It is.
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)

If I run the 'standard' test from

http://www.str.com.au/jnibench/


Throughput in rows per second (bigger is better)
JavaRowConsumer 95556
FineGrainedJNIRowConsumer       64360
CoarseGrainedJNIRowConsumer     53946
BytePackedJNIRowConsumer        56328
SocketRowConsumer       15635

Now I've changed the CoarseGrainedJNIRowConsumer to use
GetDirectBufferAddress and I'm getting the following results: 

Throughput in rows per second (bigger is better)
JavaRowConsumer 95263
FineGrainedJNIRowConsumer       64360
CoarseGrainedJNIRowConsumer     196949
BytePackedJNIRowConsumer        55379
SocketRowConsumer       15399

The direct buffer gains high througput simply couse there is no need to
copy the byte arrays.
All that was too suspicious for me, so what I've done is the simplest
posible test, and the results are far from what my expectation was.


MT.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to