powercord-org / powercord

A lightweight @discord client mod focused on simplicity and performance.
MIT License
1.2k stars 147 forks source link

High CPU usage on latest macOS while spawning update processes (Intel) #595

Closed aronson closed 11 months ago

aronson commented 2 years ago

Describe the bug When I launch powercord, an automatic update fires, or I press the "check update" button, the renderer process uses at least 100% of one CPU core and the application responsiveness drops to several seconds between UI re-renders. This gets worse as additional repositories are checked, and the issue compounds.

To Reproduce Steps to reproduce the behavior:

Expected behavior I looked at the source for the updater and the issue isn't obvious. I'd expect what it's doing to take nearly no time at all given I can run the commands myself in the directories manually in seconds. It must be some kind of threading contention.

Desktop (please complete the following information):

Additional context

Add any other context about the problem here. I do TypeScript work in my professional life. I looked through the sources but couldn't figure out how to attach my IDE, Visual Studio Code, to the running process. If I could get a debugger on the sources I'm sure I could track down the issue for you. If you have any resources on how to do that I'd be grateful. I'll also reach out on Discord.

Here's the CPU usage as seen in my process manager.

Screen Shot 2021-12-05 at 3 02 17 AM
tigattack commented 2 years ago

+1, I'm seeing the same thing. Other applications aren't noticably affected (at least in my case), but Discord slows to an absolute crawl (pretty much entirely frozen, view updates every ~5 seconds).

Big Sur 11.6, Discord Canary 0.0.279, PowerCord ab4d015.

tigattack commented 2 years ago

Still having the same issue on macOS Monterey 12.4, Discord Canary 0.0.284, Powercord cedd005.

asportnoy commented 2 years ago

I can also reproduce this issue. After running Powercord for a while, I've found that it starts running extremely slowly for some unknown reason and doesn't really stop until I restart. I thought it was due to some plugin having some crazy memory leak or something of the sort but I think that this issue is the cause.

As a temporary solution, I decreased the update interval so that it would occur less often. I also found that decreasing the concurrency limit to 1 makes a big difference when it does update. Also note that when you press the "check for updates" button, it runs all updates concurrently, which makes the app basically completely freeze.

asportnoy commented 2 years ago

This is fixed in 80f25ed02cf857744b44900840e7a4561498f4cb