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

Reduce background CPU usage #4944

Open
1 task done
probablykasper opened this issue Mar 15, 2023 · 10 comments
Open
1 task done

Reduce background CPU usage #4944

probablykasper opened this issue Mar 15, 2023 · 10 comments
Labels
enhancement [core label] performance Feedback for performance issues, speed, memory usage, etc

Comments

@probablykasper
Copy link

Check for existing issues

  • Completed

Describe the feature

When I have Zed open, it uses 0.5% CPU in the background. It's not terrible of course, but many apps stay at 0.0%, so an improvement would be great to see

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@probablykasper probablykasper changed the title Reduce CPU usage Reduce background CPU usage Mar 15, 2023
@JosephTLyons JosephTLyons added performance Feedback for performance issues, speed, memory usage, etc and removed triage labels Mar 16, 2023
@onetom
Copy link

onetom commented Jun 18, 2023

I tried zed for the 1st time today and it's eating 3.5-4% CPU, while it's idle, according to the Activity Monitor.
I'm on an M2 Pro Mac mini, running the Apple Silicon version of Zed on macOS 13.4 (22F66) Ventura.
I hope it's not trying to render the stationary text @60fps, since you said, it's "built like a video game"...

@onetom
Copy link

onetom commented Jun 18, 2023

If I set "cursor_blink": false, the CPU utilization drops to ~2%.
If I close the built-in terminal, the CPU utilization drops to 0%.
If I only hide the terminal panel, the CPU utilization hovers around ~1.4%.
In either case, the zsh process itself takes 0% CPU, so I see zed being the culprit for this waste.
"cursor_blink": true and no terminal still consumes ~1.4% CPU.
That's a bit harsh for a cursor, which only blinks once or twice a second.

Normally I wouldn't care about such details, but I find these observations being in clear contradiction to the claims I read on https://zed.dev/

@jansol
Copy link
Contributor

jansol commented Jun 18, 2023

To add to this, when the Zed window is not visible (hidden or on a different virtual desktop), CPU use drops to 0.7% on my Core i7.

SomeoneToIgnore referenced this issue Aug 30, 2023
Deals with https://github.com/zed-industries/community/issues/1116
Part of https://github.com/zed-industries/community/issues/1098

Use Mac platform callbacks to send a global event and enable/disable
caret blinking in editors when the app is not focused.

Release Notes:

- Stop blinking caret if Zed app is not focused
@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
@onetom
Copy link

onetom commented Jan 25, 2024

For the record, I'm still experiencing a fluctuating 0.1-0.3% CPU usage in Activity monitor on version 0.119.17 323fc8a313550101fece9eebe7f4a1c1da03b42f, after a clean application start, when the UI is completely stationary and I have 1 project open with 1 file visible; no blinking cursor.

@bersace
Copy link

bersace commented Jul 18, 2024

I confirm this. Just opening a terminal (task or simple terminal) instantly increase CPU usage from 0 to up to 0.19% CPU.

zed 0.145.0 preview, GNOME Wayland, Debian 12 bookworm, Intel CPU/GPU.

I usually need 4 or 5 terminals : magit, 2 foreground services, vitejs dev server, etc.

@bersace
Copy link

bersace commented Jul 18, 2024

Actually, I hear the fans soaring even if CPU is such low. I guess that's the GPU who's heating. But using integrated GPU, it's on the same chip/sensor.

@just-maiyak
Copy link

I have the same experience as @bersace, my laptop gets hot and the fans turn up after only a few minutes after firing up Zed and turn off moments after I quit the app. CPU usage is hovering 2% the whole time.

@bersace
Copy link

bersace commented Feb 5, 2025

I dont experiment this since a few weeks. I dont close terminals to save CPU anymore. I suggest closing this issue. @just-maiyak @probablykasper can you confirme ?

Zed: v0.171.6 (Zed)
OS: Linux Wayland debian unknown
Memory: 15.4 GiB
Architecture: x86_64
GPU: Intel(R) Xe Graphics (TGL GT2) || Intel open-source Mesa driver || Mesa 24.2.8-1

@probablykasper
Copy link
Author

I don't see any improvement. But if you're talking about fans ramping up, heating or GPU usage, then that has nothing to do with this issue

@just-maiyak
Copy link

I had stopped using Zed for a while, I have been using it again for the past couple days and I notice the issue is now gone indeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] performance Feedback for performance issues, speed, memory usage, etc
Projects
None yet
Development

No branches or pull requests

6 participants