V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
BBrother
V2EX  ›  问与答

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

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

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

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


    @lingex #9 python 自带的 zipfile


    @GOOD21 #10 我先研究一下


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