[muscle] Re: Patch for supporting NIO in Java client

  • From: Lior Okman <lior.okman@xxxxxxxxxxxxxxxxxxxxxxxx>
  • To: muscle@xxxxxxxxxxxxx
  • Date: Wed, 08 Feb 2006 11:57:59 +0200

Jeremy Friesner wrote:

>
>>I'm seeing a lot of time spent in the LEDataOutputStream
>>class, so this patch is the start of my attempts to "make it better".
>>    
>>
>[...] 
>  
>
>>In my first profiling comparision between the NIO and old I/O code,
>>sending 1200 Messages takes 30% more time with old I/O than it does with
>>nio.
>>    
>>
>
>Sounds good... please keep me posted on your progress.
>
>  
>

Hi,

I'm attaching a new version of the channels patch (apply to a clean 3.10
directory).

As far as sending messages is concerned, the old code and new code
perform around the same.

While receiving messages, if the workload is a lot of relativly small
messages, the new code is a more efficient - I've seen ~20% improvement:

I'm running each test twice, to get around hotspot recompilations. The
second time around is always more efficient, since the JRE has already
compiled to native code whatever needs to be compiled.

> Starting to test the old code
> Old code:5000 messages (1414717 bytes) took 3365 milliseconds to be send
> Starting to test the old code
> Old code:5000 messages (1414717 bytes) took 933 milliseconds to be send
> Starting to test the new code
> New code:5000 messages (1414717 bytes) took 1922 milliseconds to be send
> Starting to test the new code
> New code:5000 messages (1414717 bytes) took 740 milliseconds to be send

The patch includes the JUnit test class that I used for these measurements.



Besides the channels issue, this patch fixes a bug in the
NativeZLibMessageIOGateway.

Regards,
Lior

>Jeremy
>
>
>
>  
>

Other related posts: