V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
Livid
V2EX  ›  Linux

pigz - Parallel Implementation of GZip

  •  
  •   Livid · 2020-10-29 01:59:21 +08:00 · 2496 次点击
    这是一个创建于 1266 天前的主题,其中的信息可能已经有所发展或是发生改变。

    一个可以利用多核心 CPU 来加速压缩的 gzip 实现:

    https://zlib.net/pigz/

    Ubuntu 下可以直接 apt install pigz 安装。

    和原始单核 gzip 的性能对比:

    https://rachaellappan.github.io/pigz/

    6 条回复    2020-10-30 03:18:52 +08:00
    lcdtyph
        1
    lcdtyph  
       2020-10-29 02:18:58 +08:00 via iPhone   ❤️ 4
    一直在用,还有其他格式的几个
    pixz 并行版的 xz
    pbzip2 并行版的 bzip2

    和 tar 联动的话可以这样
    tar -Ipigz -xf xxx.tar.gz
    yyfearth
        2
    yyfearth  
       2020-10-29 06:40:38 +08:00
    @lcdtyph xz 不支持 multi-core 吗?
    我记得 xz 本来就有--thread 参数啊
    AlohaV2
        3
    AlohaV2  
       2020-10-29 08:45:55 +08:00   ❤️ 1
    之前试过解压速度和压缩比,zstd 在性价比上是测过最高的,也有 pzstd 库支持并发。
    https://github.com/facebook/zstd/tree/dev/contrib/pzstd
    lcdtyph
        4
    lcdtyph  
       2020-10-29 10:07:27 +08:00 via iPhone
    @yyfearth
    没,虽然提供了--threads 选项,但是 manpages 里有一句"Multithreaded compression and decompression are not implemented yet,
    so this option has no effect for now."
    AlohaV2
        5
    AlohaV2  
       2020-10-29 14:09:42 +08:00   ❤️ 1
    @lcdtyph @yyfearth
    7-zip 的 LZMA SDK 支持 xz 多线程解压,不过好像只有 Windows 平台可以。我之前还改过,加了下 Linux 的支持
    https://unique-ptr.com/archives/92.html
    不过后来一顿搜索之后,还是决定转投 zstd 了
    ericFork
        6
    ericFork  
       2020-10-30 03:18:52 +08:00   ❤️ 1
    两年前测了一大圈,考虑到很多场景下解压速度更重要,zstd 无出其右
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   960 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:51 · PVG 05:51 · LAX 14:51 · JFK 17:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.