压缩工具/算法

gzip, bzip2, xz 工具比较

原文:https://www.rootusers.com/gzip-vs-bzip2-vs-xz-performance-comparison

Conclusion

If you are interactively compressing files on the fly then you may want to do this quickly with gzip -6 (default compression level) or xz -1, however if you’re configuring log rotation which will run automatically over night during a low resource usage period then it may be acceptable to use more CPU resources with xz -9 to save the greatest amount of space possible. For instance kernel.org compress the Linux kernel with xz, in this case spending extra time to compress the file well once makes sense when it will be downloaded and decompressed thousands of times resulting in bandwidth savings yet still decent decompression speeds.

Based on the results here, if you’re simply after being able to compress and decompress files as fast as possible with little regard to the compression ratio, then gzip is the tool for you. If you want a better compression ratio to save more disk space and are willing to spend extra processing time to get it then xz will be best to use. Although xz takes the longest to compress at higher compression levels, it has a fairly good decompression speed and compresses quite fast at lower levels. Bzip2 provides a good trade off between compression ratio and processing speed however it takes the longest to decompress so it may be a good option if the content that is being compressed will be infrequently decompressed.

In the end the best option will come down to what you’re after between processing time and compression ratio. With disk space continually becoming cheaper and available in larger sizes you may be fine with saving some CPU resources and processing time to store slightly larger files. Regardless of the tool that you use, compression is a great resource for saving storage space.

Quick Benchmark: Gzip vs Bzip2 vs LZMA vs XZ vs LZ4 vs LZO

原文: https://catchchallenger.first-world.info/wiki/Quick_Benchmark:_Gzip_vs_Bzip2_vs_LZMA_vs_XZ_vs_LZ4_vs_LZO

Tarball mode from linux-3.3, original size: 466083840 (445M)

  • Compression ratio
gziplz4lzop
126.80%35.60%36.00%
225.50%35.60%35.80%
324.70%35.60%35.80%
522.00%-35.80%
721.50%-24.90%
921.40%-24.60%
  • Compression time
gziplz4lzop
18.1s1.3s1.6s
28.5s1.4s1.6s
39.6s1.3s1.5s
514s-1.5s
721s-35s
933s-1m5s
  • Decompression time
gziplz4lzop
13.5s0.4s1.5s
23s0.3s1.4s
33.2s0.4s1.4s
53.2s-1.5s
73s-1.3s
93s-1.2s

Compression Benchmarks: brotli, gzip, xz, bz2

原文: https://www.opencpu.org/posts/brotli-benchmarks/?spm=ata.13261165.0.0.45e51b1c0N9oFD

Brotli is a new compression algorithm optimized for the web, in particular small text documents. Brotli decompression is at least as fast as for gzip while significantly improving the compression ratio. The price we pay is that compression is much slower than gzip

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值