测试环境: Windows7 SP1, 32bit, 4G mem, Intel i5 CPU
循环100万次写大约20几个字节, 最终结果:
用150K缓存的ByteBuffer和RandomAccessFile写, D:/test2.tmp spent time=177毫秒
用1M缓存的ByteBuffer和RandomAccessFile写, D:/test3.tmp spent time=177毫秒
用150K的mapsize的MappedByteBuffer写, D:/test4.tmp spent time=320毫秒
用150K缓存的OutputStream写, D:/test5.tmp spent time=610毫秒
更具体内容详见我个人blog:
http://www.smithfox.com/?e=149