Skip to content
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

JSZip is 50x slower because of set-immediate-shim #750

Closed
ingun37 opened this issue Feb 23, 2021 · 2 comments
Closed

JSZip is 50x slower because of set-immediate-shim #750

ingun37 opened this issue Feb 23, 2021 · 2 comments

Comments

@ingun37
Copy link

ingun37 commented Feb 23, 2021

JSZip is significantly slow in NextJS by more than 50 times compared to other platform like Gatsby.
The reason is that there's no polyfill for setImmediate in NextJS therefore it falls back to set-immediate-shim which is a very slow library.

There already has been many pull requests/issues addressing the same problem.

#702
#716
#619
vercel/next.js#22372 (comment)

I think this long overdue issue has to be resolved once and for all.

@ingun37 ingun37 changed the title JSZip is 50x slower in NextJS because of set-immediate-shim JSZip is 50x slower because of set-immediate-shim Feb 24, 2021
@101arrowz
Copy link

It would probably be better to delegate operations to a separate thread instead of using setImmediate to let it run in the event loop. Even if JSZip doesn't freeze the browser, it still causes sluggish operation because it's crunching numbers on the main thread. Worker threads are the approach used by fflate, which is multiple times faster.

@AnzhiZhang
Copy link

Just a kind reminder that please solve this issue, it makes it difficult for me to use this library in vercel

@ingun37 ingun37 closed this as completed Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants