optimize NIO performance.