WebGL library is 2x slower in NextJS compared to other static page frameworks #22286
-
I make a WebGL library that renders realistic garments. I thought it could be a bundling problem so I tried different tools (Webpack and Rollup)with different configuration but the result was same. Bundling wasn't the problem. Then I tried running the same benchmark code on Gatsby and the result was that it was as fast as ESM module. So I guess the problem occurs only in NextJS. I guess SSR/Pre-rendering is somehow affecting the runtime performance of my library. How could a library be only slow on NextJS? How can I fix it? Has there been any runtime performance issue about NextJS? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I found it's not only my library or WebGL codes but also unzipping a file using JSZip is extremely slow. I think any cjs module are generally slow in Nextjs. I'll write another discussion with sample app that uses JSZip to demonstrate the problem. |
Beta Was this translation helpful? Give feedback.
-
I managed to reproduce in a sample app and issued a bug. #22372 |
Beta Was this translation helpful? Give feedback.
-
Replied here: #22372 (comment) |
Beta Was this translation helpful? Give feedback.
Replied here: #22372 (comment)