BBrother
V2EX  ›  问与答

请教一下,如何提高解压速度?

  •  2
     
  •   BBrother · Aug 31, 2022 · 3370 views
    This topic created in 1532 days ago, the information mentioned may be changed or developed.

    压缩包大小大概在 1G 左右,里面是非常多的小文件,大概平均 6 KB 左右。

    压缩使用的 zip ,方式是 store ,解压时间超过 19h 。

    有没有什么方式 /工具可以提高解压速度?

    15 replies  •  2022-09-06 10:04:28 +08:00
    ClarkAbe
    ClarkAbe
    Aug 31, 2022 via Android
    1
    用代码写个 reader.....然后多线程写入......或者加个通道.....先把大部分读到内存然后等慢得要死的 IO 写完......
    keepeye
    keepeye
    Aug 31, 2022
    2
    磁盘瓶颈?
    hccsoul
    hccsoul
    Aug 31, 2022
    3
    之前在 fitgril 下载的东西,解压安装时候电脑卡卡的,一看把 32g 占满了,cpu20 个框框都满了,不知道怎么做到的
    BBrother
    BBrother
    OP
    Aug 31, 2022
    4
    @keepeye #2 加压速度 14kb/s
    BBrother
    BBrother
    OP
    Aug 31, 2022
    5
    @BBrother #4 解压速度
    BBrother
    BBrother
    OP
    Aug 31, 2022
    6
    @ClarkAbe #1 实在不行就多线程试试,但是在之前我还是希望能找到现成的工具
    imouto
    imouto
    Aug 31, 2022
    7
    ramdisk
    oldshensheep
    oldshensheep
    Aug 31, 2022
    8
    1.用高速 nvme 硬盘
    2.关闭杀毒软件

    另一种方法不解压,因为 zip 没有固实压缩,所以可以直接读取想要的文件而不解压。
    lingex
    lingex
    Aug 31, 2022 via Android
    9
    现在用什么工具? Bandizip 解压支持多线程。不过你这个估计是 IO 问题比较大。
    GOOD21
    GOOD21
    Aug 31, 2022
    10
    pigz
    imzcg2
    imzcg2
    Aug 31, 2022
    11
    用内存盘
    eason1874
    eason1874
    Aug 31, 2022
    12
    解压到内存 +1

    解压到内存,速度快了说明瓶颈在硬盘,速度还是一样慢说明瓶颈在 CPU 。Linux 系统 /dev/shm 目录就是内存盘,解压到这里就可以,Windows 系统要用软件创建
    BBrother
    BBrother
    OP
    Aug 31, 2022
    13
    @oldshensheep #8 不解压可以考虑,不过服务端的改动就大了


    @lingex #9 python 自带的 zipfile


    @GOOD21 #10 我先研究一下


    @imzcg2 #11 @eason1874 #12 感谢建议,我先试试看
    ijrou
    ijrou
    Sep 6, 2022
    15
    1 、提高 cpu
    2 、换成固态硬盘,缓存要大那种
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1073 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 22:59 · PVG 06:59 · LAX 14:59 · JFK 17:59
    ♥ Do have faith in what you're doing.