Skip to content

"Code - Helper (GPU)" process uses 20+% CPU when a spinner is shown in status bar #96094

@evangrayk

Description

@evangrayk
  • VSCode Version: 1.44 insiders
  • OS Version: macOS 10.15.3

Steps to Reproduce:

  1. Have an extension that creates a status bar with a spinner, e.g.:
const vscode = require('vscode');
export function activate(context) {
    const statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
    statusBar.text = '$(sync~spin) Test';
    statusBar.show();
    context.subscriptions.push(statusBar);
}

(Often times extensions show status bar spinners for long running background tasks)

  1. When this spinner is shown, use Activity Monitor on macOS to view CPU usage. The "Code - GPU" process will use more CPU than desired just to show the spinner. On a completely blank build of VSCode, this is 5-10%. In a more typical example with extensions installed and files open, this as much as 25% CPU usage (typically 20% for me in everyday scenarios).
  2. To verify it's the spinner causing this, either: 1) hide status bar via right click and watch CPU usage go down to 1% or 2) use dev tools to disable animation CSS property and see CPU usage drop.

FWIW, this also happens to some extent in Chrome itself (the "Chrome - GPU" process) if you show a CSS animation there. Animated GIFs or less frequent animations perform better in web.

Does this issue occur when all extensions are disabled?: No, because you need a spinner to be shown. Should also repro for file tree loading spinner, but that is less long-lived.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions