-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Description
What version of Next.js are you using?
10.0.5
What version of Node.js are you using?
12.0.0
What browser are you using?
Safari, Chrome
What operating system are you using?
macOS, Windows
How are you deploying your application?
next start
Describe the Bug
Unzipping a zip file using JSZip is 50x slower in NextJS than in Gatsby.
I made a sample app that unzips a zip file on both NextJS and Gatsby. It took for 162647.844ms for NextJS while it only took for 3091.979ms in Gatsby.
I believe it's not only unzipping but execution of javascript (especially cjs modules) is generally slow in NextJS. The whole reason I've done it in the first place was because my js library was significantly slow only when it was used on NextJS app. Unzipping is just the most extreme case that I've observed. My library, which is primarily WebGL, becomes about 2~10x slower (depending on the kind of job) in NextJS compared to Gatsby or other platforms.
Expected Behavior
I expect no runtime performance difference to Gatsby.
To Reproduce
Here's the sample app
https://github.com/ingun37/nextjs-bug-reproduce-sample
NextJS
- location:
/nextjs
- How to run
yarn run dev
oryarn run build && yarn run start
- Click
Unzip and measure the time
button and check the console.
Gatsby
- location:
/gatsby
- How to run
npm i && npm run develop
- Click
Unzip and measure the time
button and check the console.