Discussions

News: Testing raw NIO performance

  1. Testing raw NIO performance (2 messages)

    Cameron 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.

    Excerpt
    One of our early concerns with NIO was its raw performance, and for good reason: In it's original JDK 1.4.0 release, performance was terrible. By the 1.4.2 release, the performance had improved (in some tests) by a factor of 3:1, and you can see in the following test output that it's "only" about 3x slower than putting data into a byte array, and "only" about 4.5x slower than accessing data from a byte array. Since there should be nothing theoretically faster than accessing data from a byte array, this is impressive, right?
    Read Cameron Purdy in Raw NIO Performance

    Threaded Messages (2)

  2. Testing raw NIO performance[ Go to top ]

    My experience is similar. However, it's not just ByteBuffer performance that is bad - it's the entire library. Also, in addition to bad performance, the APIs are cumbersome and poorly documented. Not to mention all the bugs (especially on Win32). NIO is just a mess.
  3. Optimising benchmark.[ Go to top ]

    It's possible to rearrange the benchmark to get much better results. See comments on Cameron's weblog.