electron: High CPU Usage While Idling

  • Electron version: 1.7.9
  • Operating system: Windows 10

Windows 10

My Electron application uses a lot of CPU while the BrowserWindow is not hidden. When I hide the BrowserWindow CPU usage goes back to normal rates. OSX I tried running the application on my mac and it works like a charm.

I know it is not the same processor but here are some figures Windows 10 CPU usage 50% OSX CPU usage 0%

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 22 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@ihachani It wasn’t 🤔

I’m also having high CPU usage (10-15%) in the background. I created a completely empty view to see if it was CSS or JS related and it didn’t change the CPU usage.

UPDATE: It is definitely related to browser window Transparency. With transparency off, it idles down to 0% cpu, otherwise it is always 8-15%

image

@teleclimber I don’t have any running CSS animations. The application is static while idling. The application uses transparent browser window.

 win = new BrowserWindow({
        width: 900,
        height: 428,
        useContentSize: true,
        transparent: true,
        frame: false,
        toolbar: false,
        icon: iconpath,
        webPreferences: {
            backgroundThrottling: false,
        },
    });