jasonjmcghee / rem

An open source approach to locally record and enable searching everything you view on your Mac.
https://rem.ing
MIT License
2.18k stars 60 forks source link

Animated wallpaper causes CPU/battery drain even when not recording #66

Closed roblg closed 5 months ago

roblg commented 5 months ago

I haven't had a chance to dig into this much, but I was running a debug build of rem that was not set to remember anything. And I happened to check the battery drain:

image

I checked activity and the rem process was pulling 100% doing...something? Not sure what.

Tossing here in case someone else sees same behavior w/ more details.

edit: fyi my was based on 4ea0929c30adb3d15483d246c88b176b0d7c228f with no local changes.

jasonjmcghee commented 5 months ago

Oh no! Thank you for seeing this. Very, very curious what that could be! I definitely haven't seen this behavior.

Please do feel free to investigate. Would be an awesome change to fix whatever this might be.

jasonjmcghee commented 5 months ago

If anyone can reproduce this / sees this, I’d be very interested. Tried quite a bit of different things to get this to happen and haven’t been able to.

roblg commented 5 months ago

It's reproducible for me. I get rem pegged at 100% just by running the app (from XCode, if you think that makes a difference)

M2 MBA 15", Sonoma, laptop display (in case that matters)

I hooked it up to the XCode profiler. Would share, but it's 360MB gzip-compressed. I'll post some screenshots of the cpu graphs though. It seems to be... drawing something, maybe?

image
roblg commented 5 months ago

This section is also interesting: AppDelegate.setupMenu:

image
roblg commented 5 months ago

all the execution on the main thread:

image
jasonjmcghee commented 5 months ago

Can you try disabling this?

https://github.com/jasonjmcghee/rem/blob/a92bfbd68582e42380e21896da13524ef7741302/rem/remApp.swift#L110

do you have an animated background?

roblg commented 5 months ago

That appears to have fixed it and yes, it's the default Sonoma background. (Although I didn't realize it was still animating while I had a full-screen window 😬