Closed tmatson98 closed 7 months ago
I'll try to address this in the next update. unzip
should be strictly faster than unzipSync
for sufficiently large ZIPs.
Reproduced locally. I have a potential fix for the slow performance but the crashing on ZIPs with hundreds of medium-size files might be more related to #58 than anything.
Fixed in v0.8.2.
How to reproduce
The issue can be reproduced with the following code:
The problem Trying to decompress a moderately large ZIP file (~80 MB) containing files of 200 kB to 1 MB using the async
unzip
function maxes out my system memory and CPU. UsingunzipSync
instead works perfectly and takes less an 100ms in the above code, whileunzip
takes a full minute. Increasing the ZIP size to 150 MB can causeunzip
to fail with this error:Decompressing a ZIP with 8 10MB files works okay so it seems to be mainly caused by the number of files, but the
unzipSync
function is still much faster decompressing it. Using a performance profiler the issue seems to be with the postMessage WebWorker function.Test machine has an i7 6700, 16GB RAM