-
Notifications
You must be signed in to change notification settings - Fork 3
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
Sharp library causing high cpu usage on Windows #117
Comments
Thanks for letting me know @sinankeskin. I don't have a windows machine to debug this on, but the first step is to test just sharp without this addon and see if the problem is with sharp itself or the implementation here. If you can extract the specifics from generate-icons.js and create that reproduction it would be super helpful. If you get stuck anywhere you can ping me in Ember discord |
I've tested and here is the result. Seems like this is not a Sharp library nor your implementation issue. When I run first time, below line never resolve completely. Somehow hangs.
If I change the return RSVP.all(promises); to return Promise.all(promises); this issue is not happening. Also if I change the code like RSVP.all(promises).then((values) => {
console.log(values);
}).catch(err => {
console.log(err);
}); this issue is not happening. Bottom line seems like this is an RSVP library issue. Thanks for your attention. Closing. |
Looks like good sleuthing! I'd be happy to merge a PR that removes the RSVP dependency here and uses straight Promise.all which looks like it is valid for all versions of Node back to 0.12. |
Thank you. |
hello, I've upgraded to v4.0.1 but I'm still seeing the high CPU usage and I can confirm it goes away if I remove the plugin |
Hi @void-mAlex Could you please test with sharp_test and check if the node process waits or exits? Please test the same script 2 or more times. Thanks. |
just tested and all except 1 run waited and never completed |
Hi @void-mAlex Could you please test with sharp_test again? git clone again please. I couldn't reproduce the issue. Not in debugger nor usual run. My node version is 12.16.2 Thanks. |
I've updated to node 12.16.2 |
I can (hopefully) confirm that this is a Sharp issue and I believe this line is the responsible. https://github.com/lovell/sharp/blob/70e730bb677b80879d7578a4fdb881ad34afec60/lib/output.js#L767 sharp.pipeline is a native (compiled) method which unfortunately seems like on Windows it has an issue (hangs). Feel free to open an issue on Sharp library. Also that's why I couldn't reproduce on Linux. Sorry for the dirturb @jrjohnson and thank you @void-mAlex I'm closing. |
Hi.
First of all, thank you for this addon. Really useful.
On Windows if I delete dist folder and run ember app with ember s, nodejs using high cpu.
I investigated and found out that the reason is the Sharp library. Basically I guess Sharp process keeps open itself, never kills after success. And after the uninstall your addon high cpu usage is gone.
For the record, if I close the app (without the delete dist folder) and rerun again this issue is not happening. I guess skips the creating file.
And also this issue is not happening in Linux.
Thank you.
The text was updated successfully, but these errors were encountered: