4 ms·
Java blocking I/O is faster than non-blocking, at least on Linux. This is kernel level, not language level. http://www.slideshare.net/e456/tyma-paulmultithread
by zinxq 13y ago
Java blocking I/O is faster than non-blocking, at least on Linux. This is kernel level, not language level.
http://www.slideshare.net/e456/tyma-paulmultithreaded1 http://www.slideshare.net/e456/tyma-paulmultithreaded1
- kasey_junk 13y agoYou have to be very careful what you mean by "faster" in this case. For the use case documented in those tests I assume he was measuring sustained throughput (it isn't documented well what he means by 25% slower). He was also testing a server that had lots of connections and not many messages per connection. In that case modern Linux can scale threads very well. I've done tests in other cases where NIO had nearly the sustained throughput of the blocking libraries, but had much less jitter. That is the latency through the server was much more consistent with NIO libraries than with the blocking ones. This was in a protocol with few connections but lots of messages per connection. So blanket statements about the blocking IO vs the NIO libraries being faster require more nuance than that.