-
Notifications
You must be signed in to change notification settings - Fork 334
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
[Bug] loadAndCacheImage slows down 8 times after build React app with Vite #1802
Comments
Hmmm, how much of it is request over network? |
There is no request over network. Every data coming from SSD or RAM. I have debugged the problem. The time consuming part is @cornerstonejs\dicom-image-loader\dist\esm\imageLoader\createImage.js createImage function. I'm also getting warning messages during build.
|
Have you seen our demo? does it happen in ours too? https://github.com/cornerstonejs/vue-cornerstone3d |
Can you share a minimal repository to reproduce the issue, including anonymized data and instructions on how to host it, such as the type of server to use, e.g., orthanc? dcm4chee? etc |
I'm not using any server. I'm getting dicom file from file input at client side. There is a file input in the page, please select the dicom file. When you select file the website will show alert at the top after loadAndCacheImage finished. The important point is we need to compare bundled and dev mode application run time. Bundled project can run with live-server library.
|
this does not work https://github.com/MustafaEminn/loadAndCacheImageReproduce |
Sorry. Here is the correct one |
I found why it is happening. Something happens during Vite bundling the jpeg-lossless-decoder-js library. To: It fixed the issue. I don't know what Vite is doing during bundling. |
Describe the Bug
Loading and caching 8MB MG image takes 1 second when I'm running application on my local. But same images takes 8 seconds after I built my application. I'm only using local file system not using WADORS.
vite.config.ts:
package.json:
Steps to Reproduce
The current behavior
It is very slow compared to unbundled version.
The expected behavior
It would be same as unbundled version
OS
Windows 10
Node version
20.11.0
Browser
Chrome latest
The text was updated successfully, but these errors were encountered: