ZipPatch并发压缩问题:ZipPatch() support multi-thread parallel compress mode when writing zip file, which requires more and more memory!
Picasso1990 opened this issue · comments
Picasso commented
在readme中看到ZipPatch在编写zip文件时支持多线程并行压缩模式,只是会需要更多的内存;
请问对于这个线程数量和需要patch的文件大小是否有一个最优的映射呢?例如对于1G文件的操作大概分配多少线程能够达到空间和时间的最优平衡呢?
housisong commented
你可以用ZipPatch程序在本地测试一下,可能看看大概的情况;
我们团队使用的线程数大概是3,并且开启多线程并行前会先查看CPU核数和内存大小是否足够;
当前的并行模式实现方案很耗费内存,基本上就是在内存中压缩(单线程是流式压缩),所以zip包中最大的几个需要压缩的文件决定了并行时的最大内存需求;
Picasso commented
thx,我测试试试