stratumauth / app

📱 Two-Factor Authentication (2FA) client for Android + Wear OS
https://stratumauth.com
GNU General Public License v3.0
3.04k stars 199 forks source link

Long Startup Time in the Wear OS App #184

Closed 9a3eedi closed 2 years ago

9a3eedi commented 3 years ago

Describe the bug This is a similar bug to #34 however it's specific to the Wear OS app. Cold starting the app (i.e. starting it after a long time of not using it) can take 6-10 seconds, which is rather annoying and unresponsive. The authenticator is a relatively simple app and shouldn't take this long to start in my opinion. I expect it to start within 1-2 seconds. I think the issue is caused by it needing to sync with the phone before it starts up, which can take a while. However, I think the priority should go to start up because 99% of the time a sync is not needed.

However, once its started up, closing it and then starting it becomes fast again.

Other Notes:

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

PSzczepanski1996 commented 3 years ago

Describe the bug This is a similar bug to #34 however it's specific to the Wear OS app. Cold starting the app (i.e. starting it after a long time of not using it) can take 6-10 seconds, which is rather annoying and unresponsive. The authenticator is a relatively simple app and shouldn't take this long to start in my opinion. I expect it to start within 1-2 seconds. I think the issue is caused by it needing to sync with the phone before it starts up, which can take a while. However, I think the priority should go to start up because 99% of the time a sync is not needed.

However, once its started up, closing it and then starting it becomes fast again.

Other Notes:

  • I have 4 keys stored at the moment.
  • I'm running it on a Huawei Watch 2 0195 with Wear OS version 2.26

Can confirm that on Oppo Watch 41mm with Snapdragon 3100, 1GB ram and WearOS 2.27 I have about 7 tokens and first run takes 3-5 seconds to launch Authenticator, also icons updates are delayed by next period of few seconds. Not sure if it's fixable and maybe depends on external library/Android API. Maybe WearOS 3.0 will be faster and will be ported to old 3100 watches (?)

jamie-mh commented 3 years ago

I've looked into this, but I'm not sure there is anything I can do about it. Most of the time taken in startup is before any of the app's code runs. The app uses Xamarin, so there is definitely some overhead. WearOS watches aren't that powerful so it's quite noticeable.

The app startup is as follows:

So mostly, the problem comes from the app getting ready to launch before the app code is run. So unless I've missed something, I don't see what can be improved 🤔.

9a3eedi commented 3 years ago

The black screen does take some time and I understand there's not much that can be improved here, however the progress bar is my main complaint here. It takes like 5-6 seconds from a cold start. However I was under the impression that it was syncing with the phone. I'm surprised that it's only fetching data from device storage! Maybe it's the icons that's taking so much time to load?

jamie-mh commented 3 years ago

5-6 seconds for the progress bar seems rather long, on my watch (Moto 360 gen 3) it only takes a couple of seconds, maybe the storage chip on your watch is particularly slow. Which is surprising since I was under the impression that all Wear OS hardware was relatively homogeneous.

However, I don't believe it's due to the loading of icons as the built in ones are loaded during the black screen (with the rest of the app resources) and the custom ones are loaded asynchronously when they appear in the list. The list is visible while the icons are loading in the background.

kalikiana commented 2 years ago

Maybe WearOS 3.0 will be faster and will be ported to old 3100 watches (?)

About 2s cold and instantly afterwards on my Galaxy Watch 4. I didn't really see anything before the blue progress bar, so maybe they fixed how apps are started?

Maybe that helps. I just saw the issue browsing and figured I could provide some data for comparison.

jamie-mh commented 2 years ago

Thanks for your feedback. Though, I'm not sure if this is due to an improvement in app performance or simply because the Galaxy Watch 4 is significantly more powerful that any previous Wear OS watch.

9a3eedi commented 2 years ago

After looking at newer Wear OS watches, I have come to the conclusion that my watch is simply very slow in general and needs an upgrade because Wear OS is just too heavy for the specs this watch has. Kinda like how the first android phones were terribly slow and couldn't keep more than one app in memory at a time. At the same time I noticed that recent updates to this app kinda make it more responsive, maybe it's just me.

So maybe this issue can be closed.

PSzczepanski1996 commented 2 years ago

Maybe WearOS 3.0 will be faster and will be ported to old 3100 watches (?)

About 2s cold and instantly afterwards on my Galaxy Watch 4. I didn't really see anything before the blue progress bar, so maybe they fixed how apps are started?

Maybe that helps. I just saw the issue browsing and figured I could provide some data for comparison.

Can confirm that, I got Galaxy Watch4 for christmas, and the authenticator just opens on the fly. Maybe the reason is that Snapdragon 3100 is really dated CPU, released more than five years ago, and it was not even on the par with Apple Watch these days.

jamie-mh commented 2 years ago

Ok, thanks for the updates. Closing for now.