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

High cpu consumption after first login #1

Closed
mromanbanks opened this issue Jan 29, 2021 · 14 comments
Closed

High cpu consumption after first login #1

mromanbanks opened this issue Jan 29, 2021 · 14 comments

Comments

@mromanbanks
Copy link

After a first login the app is very glitchy and unusable. CPU consumption goes over 100% so I had to force quit the app. On second launch things are better, but sometimes I see sparks up to 60%. MBP 13' 2020 base specs

@lbrndnr
Copy link
Owner

lbrndnr commented Jan 29, 2021

I observed this too and I must admit that I have no idea where this comes from and also don't really know how to debug this issue. I'm not even certain whether this is a bug in SwiftUI or in my implementation...

@alex-taffe
Copy link

Same issue here

@alex-taffe
Copy link

I can help debug this but need some feedback on #3 first

@lbrndnr
Copy link
Owner

lbrndnr commented Jan 29, 2021

As I said, I have little to no clue where this comes from. I noticed however that the profile images sometimes cause a memory spike (that's why I changed the image loading framework from sdwebimage to urlimage, this seemed to help). In particular the profile image in the toolbar seemed to make a big difference, again, no idea why.
It's also possible that the InfiniteList view causes the lagging, too, so maybe checking this out could help as well :)

@alexkaessner
Copy link

+1 from my side. I’ve noticed that as soon as I start using the app – scrolling around or clicking on the navigation – the app renders itself practically unusable. It’s responding super slow and the system declares it as „not responding“, though it eventually reacts to some clicks. Just very slow (the GIF is not cut in any way):

Screen recording

PS: I’m running the v0.0.1-alpha on macOS 11.1

@lbrndnr
Copy link
Owner

lbrndnr commented Jan 30, 2021

@alexkaessner do you experience this issue only after login or in general?

@alexkaessner
Copy link

@lbrndnr Always. I've restarted the app a few times, but the issue still appears.

@lbrndnr
Copy link
Owner

lbrndnr commented Jan 30, 2021

Hmm damn that's a shame. Would be interesting to see if it made a difference for you if you removed the profile images (e.g. returned EmptyView in RemoteImage in the Externals file)

@lbrndnr
Copy link
Owner

lbrndnr commented Feb 1, 2021

Ok, SwiftUI's slider seems to be the problem that causes lots of unnecessary renders. I'm now writing a custom slider view, which will be necessary for nicer UI anyways. Would be great if this fixes the problem for you too :) The code can be found in the slider branch. Note that the sliders are now lacking some functionality which I will implement in the coming days

@lbrndnr
Copy link
Owner

lbrndnr commented Feb 3, 2021

@alexkaessner @mromanbanks Could you check whether the latest commits improve the CPU footprint a little?

@mromanbanks
Copy link
Author

@lbrndnr Can you please publish compiled version for the app? 🙏

@lbrndnr
Copy link
Owner

lbrndnr commented Feb 4, 2021

@mromanbanks done

@mromanbanks
Copy link
Author

Now it's better. Still see spikes up to 60% when scrolling feed/album for the first time, but app is usable 👍

@lbrndnr
Copy link
Owner

lbrndnr commented Feb 4, 2021

@mromanbanks ok great, I think I just gotta dig out these little quirks to make it more lightweight. But glad it's usable for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants