halfmexican / battery-usage-wattmeter-extension

Shows charging/discharging consumption (+/-) in Watts next to battery percentage level. Default sync reload set to 4 seconds. No consumption info when battery is full. Fork of https://github.com/wennaspeedy/batt_consumption_wattmetter
GNU General Public License v3.0
6 stars 4 forks source link

Freezing / frame drops in game #8

Open FlyingBaguett3 opened 7 months ago

FlyingBaguett3 commented 7 months ago

While playing Celeste it would regularly freeze up / stutter (haven't had the opportunity to try another game, that game runs at 30fps). I found the stutters to be linked to the sync interval of the wattmeter extension, disabling it fully was the only way to get rid of them.

Running Manjaro, Gnome 45.4 on an HP pavillion laptop with Ryzen 5 5500U 16GB RAM. If you need any more information let me know.

halfmexican commented 7 months ago

I'm currently using Glib.timeout_add to schedule syncing. I inherited it from when I forked the repo. I could make a branch and test out using Glib.timeout_add_seconds

The grouping of timers to fire at the same time results in a more power and CPU efficient behavior so if your timer is in multiples of seconds and you don't require the first timer exactly one second from now, the use of index.timeout_add_seconds is preferred over index.timeout_add.

we're just collecting battery info so I don't think we need millisecond precision, I haven't ran into this issue on my XPS but it should help preformance

halfmexican commented 7 months ago

@FlyingBaguett3 are you still experiencing the issue after the latest update?

FlyingBaguett3 commented 7 months ago

Sorry I didn't reply earlier. Yes it seems like the issue is still present

FlyingBaguett3 commented 7 months ago

Screencast from 2024-03-02 20-48-03.webm here's a video of the behavior as described, I also checked with all other manually installed extensions disabled, so as to eliminate the possibility of a conflict between extensions.

halfmexican commented 6 months ago

in the latest version being reviewed, I've included commits which reduce the priority of the sync method (which I pray helps) and added support for GNOME 46.

halfmexican commented 2 months ago

I'm looking into a solution to stop updating our label if a game is in fullscreen. This won't fix users who play windowed

halfmexican commented 2 months ago

We're also loading files synchronously. I'll refactor using Gio File