Skip to content
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

High CPU usage on idle #1978

Open
rex4539 opened this issue Nov 3, 2024 · 2 comments
Open

High CPU usage on idle #1978

rex4539 opened this issue Nov 3, 2024 · 2 comments
Labels
A-Performance O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@rex4539
Copy link

rex4539 commented Nov 3, 2024

Steps to reproduce

  1. Have Element idle in background.

Outcome

What did you expect?

Low CPU usage.

What happened instead?

CPU usage around 7-8%
Screenshot 2024-11-03 at 06 53 58

Operating system

macOS 15.1

Application version

Element Nightly 2024110201

How did you install the app?

https://packages.element.io/nightly/install/macos/index.html

Homeserver

matrix.org

Will you send logs?

No

@dosubot dosubot bot added A-Performance O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist labels Nov 3, 2024
@arobertn
Copy link

arobertn commented Nov 18, 2024

I see the same (well at 4% rather than 8%) on an Intel 16" Macbook Pro running macOS 14.7.1 and Element 1.11.85, meaning I'll quit Element if not actively using it in order to preserve battery. It doesn't matter if Element is active, is showing with another app active, or hidden. Neither VS Code nor Slack show the same behavior. Are you configuring the Javascript event loop in some kind of "spin mode" rather than wait-for-IO?

@dbkr
Copy link
Member

dbkr commented Nov 18, 2024

Just fired up the profiler to see if anything obvious comes out and it looks like https://github.com/floating-ui/floating-ui is stuck in a loop where its observer modifies the dom and therefore triggers another observe event, but it's throttled to only run every second so it's a small background hum rather than a 100% CPU loop: https://github.com/floating-ui/floating-ui/blob/ba32495e65a1616c8ee5ab98ebbc80705482ed34/packages/dom/src/autoUpdate.ts#L90

floating-ui/floating-ui#2831 may be related. I'm not sure what piece of UI would be floating.

@dbkr dbkr added O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience and removed O-Occasional Affects or can be seen by some users regularly or most users rarely labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Performance O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

No branches or pull requests

3 participants