zed icon indicating copy to clipboard operation
zed copied to clipboard

Significant battery usage on MacOS

Open inuoshios opened this issue 1 year ago • 5 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

Anytime I startup Zed, I get the MacOS using significant energy warning, and I've also noticed it drains my battery faster. This warning is showed immediately I open the editor <10s.

Environment

Zed: v0.107.7 OS: 13.6 Memory: 16 GB Architecture: x86_64

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

image

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

inuoshios avatar Oct 17 '23 13:10 inuoshios

Hey @inuoshios, does this happen no matter the type of project or size? Does it happen if you open just an empty window in Zed? Does the message about using significant energy go away after some time or does it persist the entire time Zed is open?

JosephTLyons avatar Oct 17 '23 15:10 JosephTLyons

It happens even if I open an empty window, and no, it doesn't go away after some time, it only goes away after I close the editor. @JosephTLyons

inuoshios avatar Oct 17 '23 15:10 inuoshios

I can confirm this behavior. I have VSCode and Zed both running in background with empty window and only Zed is notified as a hight energy consumer. image

jezikk avatar Oct 17 '23 17:10 jezikk

Can confirm, I just noticed it. At one point it had an energy impact of above 4000... but I'm not aware how bad that is 🤷🏾 .

Update: I'm seeing a spike on opening css files. On the bottom nav it keeps saying, Dowloading css-lsp and keeps disappearing and appearing again.

https://github.com/zed-industries/community/assets/3809354/0a6f2b0a-7f9a-47f0-99c9-ea546e8c0276

deviprsd avatar Oct 21 '23 01:10 deviprsd

I can confirm this issue. I recently installed zed (0.134.4) on MacOs looking for an atom replacement which seems to have no more updates. Since the first time I launched zed, it has stayed in that significant energy location. I think I would stay with atom a little bit more until this issue is fixed

jonee avatar May 16 '24 15:05 jonee

coming from the above issue ^ (https://github.com/zed-industries/zed/issues/12449) I'm also experiencing high battery usage on my MacBook Air M3.

Screenshot 2024-05-31 at 21 31 33

my MacBook is brand new, 3 days old. and I noticed the energy impact the same day I started using zed on this laptop. I didn't have this problem on my MacBook Air M1 working on the same projects/repositories.

for me, the energy usage is slim to none on very small projects, like a newly created cargo project, but as soon as there are a few hundred lines of codes I sometimes get that energy usage warning, it's very difficult to replicate because it's almost random?

since I created my (now closed in favor of this one) issue I've been able to understand the impact better, my battery is drained very fast when I work with zed (keep in mind, my MacBook is brand new) and no other app is draining it as fast, I had about 32% an hour ago and been working on zed since then and now I have about 4% left, yesterday I was working on a project in pycharm for roughly 2 hours and lost about 17%.

not sure if the following screenshots will be of any help, but just in case ive captured some data from activity monitor after having zed open for a few minutes (this is when I have a energy usage warning):

Screenshot 2024-05-31 at 21 31 05 Screenshot 2024-05-31 at 21 31 49

in my other issue it was suggested it might be rust-analyzer when it comes to rust projects, it might be I'm not sure but I'm down to try any tests I have to do to help figure out what the actual problem is.

it might also be a manufacturing defect on this laptop, I'm not sure. I have yet to experience this problems on other software first

nervenes avatar May 31 '24 19:05 nervenes

just created a new cargo project for a simple game I wanted to make, barely any code (so I'd assume that'd rule out rust-analyzer) and zed has high energy consumption, I'm not compiling either so that'd be ruling out rustc too? I'd really appreciate if someone could look into this and push out a fix as soon as possible, I'll have to use vscode in the meantime for the sake of this laptops battery health, and I can confirm I have no energy consumption problems in vscode.

https://github.com/zed-industries/zed/assets/146845123/fcf3e629-2744-4950-aed1-4d1fa21c249e

nervenes avatar Jun 01 '24 18:06 nervenes

I tried with a minimal python project and the same thing happened, but this time my chip got extremely hot and I immediately shut down my laptop, I'm not comfortable trying to replicate this problem on my laptop again, sorry. I hope this gets solved asap

nervenes avatar Jun 01 '24 18:06 nervenes

As soon as I write code in Zed, the MacBook fan buzzes, and as soon as I stop editing, after a while, it doesn't ring much.

MacBookPro: 2014
MacXOS: Big Sur 11.7.10
Zed: 0.137.6

xgfone avatar Jun 03 '24 13:06 xgfone

@xgfone or @evrensen467 do either of you have time to screen share with me to see if we can try and debug what's going on here?

https://calendar.google.com/calendar/u/0/appointments/schedules/AcZssZ338_067BG6UMh8ClawRpwJ12b65O1K9OCRCMMDeOGZgZihmUNQJqVmnYkNpVgQadFPyYFnOPrB

ConradIrwin avatar Jun 03 '24 16:06 ConradIrwin

I had this issue too on my 2019 Intel Macbook Pro but after one of the recent updates, it seems to be fixed for me now.

Zinidia avatar Aug 05 '24 17:08 Zinidia

I had this issue too on my 2019 Intel Macbook Pro but after one of the recent updates, it seems to be fixed for me now.

Since I have the same laptop for work, I installed the latest MacOs update. Then I uninstalled zed. Then installed zed from brew. Seems to look good. Will start to evaluate and use zed from now on.

Thanks!

@Zinidia @ConradIrwin

jonee avatar Aug 06 '24 03:08 jonee

I'm going to go ahead an close this as there have been multiple major performance improvements since this was opened a year ago.

The most recent comments were likely a duplicate of this:

  • https://github.com/zed-industries/zed/issues/17305

If you are still experiencing significant battery usage, please open a new issue with full details of your system and steps to reproduce. Thanks for reporting!

notpeter avatar Nov 04 '24 00:11 notpeter