NIO slow (no buffering?)

A

Andrey Kuznetsov

see http://uio.imagero.com and http://uio.imagero.com/performance.html
I managed to read the file and iterate thru it in 4 byte chunks in about
60ms using NIO and a DirectByteBuffer. Do you think UIO can beat this? ;)
uio can't beat IO or NIO if you use them correct.
uio makes buffering for you (so you always have the best performance),
and makes io handling more comfortable - for example with reading/writing of
primitive arrays.
If you use IO or NIO incorrect (i.e. calls readInt() million times)
then you can see that UIO gives you 100 time better performance.
 
T

Thomas G. Marshall

Timo Nentwig coughed up:
That's the topic of this thread: am I actually losing anything if I
lose NIO. When it comes to my tests: no. And I wonder wonder about
the "N" in NIO...

Funny, 'cause I was wondering wondering about the "i" in your "6MiB"...
 
T

Thomas G. Marshall

Skip coughed up:
NIO is IO with another approach (allowing non-blocking IO)


It's more than that. I'm not sure you implied this or not, but "NIO", by
the way stands for "new I/O", not non-blocking.

NIO attempts to stay much closer to the underlying OS's IO facilities. It
does not require a creation of object after object in the decorator pattern,
like java.io does. As a result it is in /general/ much faster.


....[rip]...
 
T

Timo Nentwig

Thomas said:
NIO attempts to stay much closer to the underlying OS's IO facilities. It
does not require a creation of object after object in the decorator
pattern,
like java.io does. As a result it is in /general/ much faster.

All I'm missing is a ByteArrayInputStream...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,619
Members
45,316
Latest member
naturesElixirCBDGummies

Latest Threads

Top