On Sun, Aug 21, 2005 at 03:08:33PM +0200, Oleg Kalnichevski wrote:
> I have also compiled another bunch of test cases intended to test
> performance of various read operations. Interestingly enough, but not
> entirely unexpectedly, NIO handsomely outperforms classic IO when
> reading single bytes and lines of text:
> 
> ==============================
> Old IO byte array read average time (ms): 246
> NIO byte array read average time (ms): 216
> Old IO one byte read average time (ms): 537
> NIO one byte read average time (ms): 178
> Old IO one line read average time (ms): 340
> NIO one line read average time (ms): 77
> ==============================
> Source [2]
> 

What a bloody mess. I ran the test on my WinXP box at work and this is
what I got:

Java 1.4.2.3
==============================================
Old IO byte array read average time (ms): 1031
NIO byte array read average time (ms): 1094
Old IO one byte read average time (ms): 281
NIO one byte read average time (ms): 296
Old IO one line read average time (ms): 157
NIO one line read average time (ms): 157

Java 1.5.0.3
=============================================
Old IO byte array read average time (ms): 955
NIO byte array read average time (ms): 1017
Old IO one byte read average time (ms): 250
NIO one byte read average time (ms): 281
Old IO one line read average time (ms): 141
NIO one line read average time (ms): 125


Classic IO seems to outperform NIO on Windows, whereas the same test run
on my Linux box produced the opposite result

Anyone observing the same phenomenon?

Oleg


> Please let me know if you can spot any flaws in the test cases
> 
> Cheers,
> 
> Oleg
> 
> [1]
> http://svn.apache.org/repos/asf/jakarta/httpclient/trunk/http-common/src/test/tests/performance/RawNIOvsRawOIOTest.java
> [2]
> http://svn.apache.org/repos/asf/jakarta/httpclient/trunk/http-common/src/test/tests/performance/HttpNIOvsHttpOIOTest.java
> 
> On Sat, 2005-08-20 at 22:01 +0200, Oleg Kalnichevski wrote:
> > Folks,
> > 
> > I have just identified another problem with HttpCommon code, which
> > causes massive performance degradation when streaming in or out chunked
> > data. I also suspect HttpDataReceiver and HttpDataTransmitter interfaces
> > will have to be completely rethought. Since it is very rainy and cold
> > here, and the weekend looks all but ruined, I guess this is just the
> > perfect opportunity to get some code fixed ;-)
> > 
> > Oleg
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

Reply via email to