careteditor / issues

Caret issues
https://caret.io
326 stars 12 forks source link

Unjustifiable battery usage #162

Open ebeloded opened 7 years ago

ebeloded commented 7 years ago

Caret is using an insane amount of battery power. Here is a screenshot of battery usage by app on my Windows 10 PC:

image 009

Please note that I launch Caret couple times a day and use it sparingly, unlike Chrome, which is always on with multiple windows and dozens of tabs open.

Additionally, I want to point out that the problem is not with Electron: Visual Studio Code and Slack are also Electron-based apps and they are active all the time in my environment. VS Code is under heavy pressure all the time.

It makes no sense why a text editor (yes, simple and beautiful) is using so much power. I think it is very important for a text editor to be very gentle with the battery. People would want to use this kind of app on their laptops off the grid for long periods of time.

Wish you luck with finding the problem! I would also really appreciate if you could share your findings.

erusev commented 7 years ago

It makes no sense why a text editor (yes, simple and beautiful) is using so much power. I think it is very important for a text editor to be very gentle with the battery. People would want to use this kind of app on their laptops off the grid for long periods of time.

I absolutely agree - we'll investigate.

Thanks.

ebeloded commented 7 years ago

My blind guess is that hardware acceleration is forced with CSS on everything. CSS Hardware acceleration is known for increasing the memory usage, as well as draining the battery.

This one would be easy to disconfirm.

erusev commented 7 years ago

Sure, we'll check that, it could also have something to do with automatic updates.

astoilkov commented 7 years ago

Hi @ebeloded,

We investigated the problem and we found out that Caret is doing background work while the app is not focused. We eliminated that and now the app should drain battery only if it is being used. This means that if you are using it rarely you shouldn't see Caret in your statistics.

This changes are available in the latest Caret 1.9.1 release. Could you try them out and see if you will see a difference?

Thanks in advance.

ebeloded commented 7 years ago

Great news, thanks! Will get back to you in a week after stats has been gathered.

astoilkov commented 7 years ago

@ebeloded Did you had chance to look at the new battery usage of Caret for the past week?

ebeloded commented 7 years ago

Caret still holds second position in my battery usage for last week:

image

I kept the app always up to date and didn't change the way I use it.

astoilkov commented 7 years ago

Thanks for the information. Can you answer a few quick questions so we could know how to approach this.

astoilkov commented 7 years ago

@ebeloded Any news or changes with the experienced problem?

ebeloded commented 7 years ago

I'm sorry - this issue and your comment with questions slipped my radar.

Also, I was getting very unpredictable results from windows battery usage stats. It made me think that the stats may not be very reliable, thus the issue may not be with Caret at all.

I will give the battery testing another run today while using the app a lot. I'll get back to you at the end of the day and share my results.

ebeloded commented 7 years ago

Hey. I've been keeping an eye on the battery usage within varying time periods and it looks that the problem persists. Caret is reliably among top 5 apps to drain the battery. The stats also looked pretty coherent with the actual usage of apps.

I'll give you answers to your questions with my own observations:

  1. My estimate of the time I spend in Caret is about 20 minutes of approximately 8 hour workday. That would be an average. Some days I could spend 10 minutes writing, other days up to an hour. I always have only one instance of the app open at a time.
  2. Most of the time I leave the app running in the background;
  3. Autosave is on;
  4. I have a relatively new machine with an SSD drive;
  5. I never use Split view;

Hope that helps.