link about poor NIO performance

I found this link on theserverside.com :

<<Cameron Purdy has written about his experience with NIO, which he uses in Coherence. He talks about how it is maybe slower than you think, and gives test code so you can see the results for yourself. >>

http://jroller.com/page/cpurdy/20040405#i_met_the_fabled_unified

[quote]I found this link on theserverside.com :

<<Cameron Purdy has written about his experience with NIO, which he uses in Coherence. He talks about how it is maybe slower than you think, and gives test code so you can see the results for yourself. >>

http://jroller.com/page/cpurdy/20040405#i_met_the_fabled_unified
[/quote]
Until Sun’s NIO team bother to release guidelines for what performance to expect of NIO, and how you are supposed to use it, it’s very hard to know what is a bug and what is people using the API wrongly.

e.g. the problem I found with gathering writes being slower than non-gathering writes for more than 10 input buffers, and not any faster even with just 2 buffers, appears to be a bug (and was filed with Sun).

OTOH, the fact that 1000 buffers causes gathering writes to operate thousands (or even millions) of times slower than plain writes - is this a bug? Or should we not be using that many buffers?

This guy is using a 100Mb direct BB - is this a bug? Or should he be using indirect BB’s for that much data and this particular kind of access?

I think you pointed the real problem, when it will be documented ::slight_smile:

On a side note, is there an alternative to NIO (except the regular IO)

JNI ;D

[quote]JNI ;D
[/quote]
I like my dinner prepared, not raw ;D

There are some other asynchronous I/O libs that people wrote for java before 1.4 came out, you’ll have to google around for them. I’ve seen quite a few about, but haven’t looked for years, so I don’t know where’s best to start right now.

You could try SEDA, which IIRC had it’s own open-source asynch IO lib.