NIO Performance Improvement compared to traditional IO in Java

后端 未结 10 850
梦谈多话
梦谈多话 2020-12-04 16:13

I have seen many articles/blogs saying that Java NIO is a better solution compared to traditional Java IO.

But today one of my co-worker showed me this blog http://m

10条回答
  •  情话喂你
    2020-12-04 16:35

    The problem with the article is it compares blocking IO vs non-blocking NIO. In my own tests comparing blocking IO vs blocking NIO (more like for like) NIO is up to 30% faster.

    However unless your application is trivial, like a proxy server, its is unlikely to matter. What the application does is far more important. Both IO and NIO have been tested with up to 10,000 connections.

    If you want super fast IO you can use Asynch IO (Java 7+) with Infiniband (not cheap, but lower latency)

提交回复
热议问题