论坛首页 Java企业应用论坛

Java append 二进制大文件的几种方法速度比较

浏览 1781 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (15)
作者 正文
   发表时间:2011-06-09  

测试环境: 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

 

 

论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics