-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extremely slow performance of generateAsync with 3.2.X JSZip versions #617
Comments
Hi @TestPolygon, Based on your code, I added a live demo here: https://jsbin.com/kuxutodini/edit?html,console From the output of your test, I assumed you were using a 2.75MB blob, added respectively 1, 10 and 50 times to a zip. I managed to reproduce your performance issue (tested both Chrome 76 and Firefox 69), with version 3.2.5 taking from 10 to 35 times longer than 3.1.5 to generate a zipped output. I hope this can help debugging the issue. |
The naive implementation from the 'set-immediate-shim' package, based on setTimeout(..., 0) is order of magnitude slower than the clever ponyfill from core-js. See Stuk#617
I used this lib on a personal project today and was ready to give up when I found this issue. With 3.1.5 its quite fast generating one large zip that I need (+/- 10s) and in latest it takes above 10m and thats not an amount of time acceptable to download a file. This to say that (in my opinion) this issue is a blocker and having a PR prepared, this should be top priority. |
+1 |
Hi, @TestPolygon , I think the PR #702 may resolve this issue. Could you plz test with it ? |
I can only check the first 2 commits. Using 64k block size is definitely the better thing, even I don't undetstand why the rep owner @Stuk ignores this issue. Maybe someone ping him on other platforms? |
Thank you @xqdoo00o ! |
Performance issues as documented here: Stuk/jszip#617
Performance issues as documented here: Stuk/jszip#617
Wow, just downgrading to 3.1.5 made it hundreds times faster... |
Looks like this is finally fixed in |
after bumping the JSZIP version to ^3.10.1, I still faced the same issue. |
Performance issues as documented here: Stuk/jszip#617
generateAsync
works ~50 times slower in JSZip 3.2.X than in JSZip 3.1.5!I use JSZip in a Chromium 76 based browser.
Here is a code to test it:
The example
For
addBlobToZipMultipleTimes(blob, 1)
:JSZIP 3.1.5:
JSZIP 3.2.1:
JSZIP 3.2.0, 3.2.2 have the same speed.
22 ms vs 926 ms!
Some more examples
JSZIP 3.1.5:
JSZIP 3.2.1:
97 ms vs 4944 ms
For 41.29 MB:
JSZIP 3.1.5:
JSZIP 3.2.1:
287 ms vs 14723 ms
For 137.65 MB:
JSZIP 3.1.5:
JSZIP 3.2.1:
0.8 sec vs 49 sec!
The text was updated successfully, but these errors were encountered: