-
Notifications
You must be signed in to change notification settings - Fork 14
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
Why import { CanvasCapture } from 'canvas-capture' cause cpu usage 99%? #14
Comments
Hey, thanks for the issue. Can you be a little more specific, which performance monitor in chrome? The built-in one in the devtools? can you post a screenshot? Nothing really "happens" in my codebase when the import occurs, so I wonder if this is coming from a dependency. Do you have any insight into what functions are being called that are hogging the CPU? |
Yes, the built-in one in the devtools. Thanks for replay, I will create another empty project to test. |
Steps to reproduce the problem:
2.Add electron dev tool, install canvas-capture, and run
3.Press F12 to open Chrome Dev Tools in your electron app, check the Performance monitor, the CPU usage is low currently 4.Import CanvasCapture in Home.vue, save the change, then check the monitor again, the CPU usage is up to 99%
By the way, the final product (npm run electron:build) has no weird cpu high usage. Maybe something in electron dev mode are conflict with canvas-capture. |
thanks for this info. will take a look when I get the chance. good to know it's not affecting the final build! |
I found that, if I require CanvasCapture in mounted, the CPU usage will be fine.
It is weird, but seems to be a work around. |
thanks for the update on this @wxfred ! |
Same problem here, the whole browser is lagging (Chrome 117.0.5938.132). My CPU is i9 13900K so it's definitely not a hardware issue. @wxfred's proposal solves it, but then I lose TypeScript types. |
@SvetlozarValchev yeah sorry about that - I'm hoping to do a big rewrite of this when I get to it with my current project that should fix these issues. A lot of the code in the repo (e.g. gifjs, CCapture, all the ffmpeg stuff) was not written by me and it does not seem to be playing well in compiled js environments. |
I‘m using electron to develop vue app, and only import this package with
import { CanvasCapture } from 'canvas-capture'
the Chrome Performance monitor shows the cpu usage is up to 99%!
After commented out the import, the cpu usage is lower than 10%.
The text was updated successfully, but these errors were encountered: