忘记密码   免费注册 查看新帖 | 论坛精华区

ChinaUnix.net

  平台 论坛 博客 认证专区 大话IT HPC论坛 徽章 文库 沙龙 自测 下载 频道自动化运维 虚拟化 储存备份 C/C++ PHP MySQL 嵌入式 Linux系统
最近访问板块 发新帖
查看: 1002 | 回复: 0

[算法] 压缩世界之七大武器 [复制链接]

论坛徽章:
0
发表于 2017-08-12 14:56 |显示全部楼层
LZO: Start compressing the file log.txt
LZO: End of compression and cost time: 558.079000 ms
LZO: Compressed file size 102423143 bytes   compression ratio: 27.53%
LZO: Start decompressing the file lzoCompress.dat
LZO: End of decompression and cost time: 903.214000 ms
LZ4HC: Start compressing the file log.txt
LZ4HC: End of compression and cost time: 8132.321000 ms
LZ4HC: Compressed file size 95853187 bytes   compression ratio: 25.77%
LZ4HC: Start decompressing the file...
LZ4HC: End of decompression and cost time: 268.572000 ms
ZSTD: Start compressing the file log.txt
ZSTD: End of compression and cost time: 1097.545000 ms
ZSTD: Compressed file size 62092000 bytes   compression ratio: 16.69%
ZSTD: Start decompressing the file zstdCompress.dat
ZSTD: End of decompression and cost time: 557.305000 ms
LZMA: Start compressing the file log.txt
LZMA: Using multi-thread to compress data...
LZMA: End of compression and cost time: 55847.316000 ms
LZMA: Compressed file size 49139755 bytes   compression ratio: 13.21%
LZMA: Start decompressing the file lzmaCompress.dat
LZMA: properties: 0x5D 0x00 0x00 0x00 0x01
LZMA: End of decompression and cost time: 3135.718000 ms
LZMA2: Start compressing the file log.txt
LZMA2: Source file size: 371999998 bytes
LZMA2: Set the properties as 24
LZMA2: Compressed file size 47763899 bytes   compression ratio: 12.84%
LZMA2: End of compression and cost time: 76932.834000 ms
LZMA2: Start decompressing the file lzma2Compress.dat
LZMA2: Read the properties of compressed file 24
LZMA2: Compressed file unpack size: 371999998
LZMA2: End of decompression and cost time: 3221.341000 ms
ZLIB: Start compressing the file log.txt
ZLIB: End of compression and cost time: 8191.329000 ms
ZLIB: Compressed file size 67953690 bytes   compression ratio: 18.27%
ZLIB: Start decompressing the file zlibCompress.dat
ZLIB: End of decompression and cost time: 770.533000 ms
BROTLI: Start compressing the file log.txt
BROTLI: End of compression and cost time: 707150.089000 ms
BROTLI: Compressed file size 51501063 bytes   compression ratio: 13.84%
BROTLI: Start decompressing the file BrotliCompress.dat
BROTLI: End of decompression and cost time: 1001.152000 ms

以上都是各算法最新版本的C源码编译,在同一个应用程序中测试,同样环境压缩一个200万条数据的数据库文件。至于Google的Brotli,实在想不出,写了那么多代码,为何压缩效能那么差,不管什么级别压缩,都不及LZMA2。而且解压速度只能算中等。所有编码,采用128K Buffer。LZMA无论怎么来讲,都比WinRAR压缩率高。LZ4HC如果采用LZ4快速编码,1s可以编码完,解码速度实在是世界一流。Facebook最新的ZSTD算是做到了最佳的平衡,但ZSTD无论多高压缩参数,都还是敌不过LZMA2,而且压缩时间会更长。因此,从压缩率来讲,LZMA2几乎从未被超越;从压缩和解压速度来讲,LZ4是相当不错的,其快速压缩,400MB源文件,都是秒级反应。

=================================================
纸上得来终觉浅,绝知此事要恭行
您需要登录后才可以回帖 登录 | 注册

本版积分规则

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号 北京市公安局海淀分局网监中心备案编号:11010802020122
广播电视节目制作经营许可证(京) 字第1234号 中国互联网协会会员  联系我们:
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP