-
Notifications
You must be signed in to change notification settings - Fork 53
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
QR image generating taking too long #278
Comments
@thunderbiscuit is the issue there on other devices?? |
Yes I think there are a few things at play here. This is a good place to discuss maybe what's wrong with this screen. One of the issues with that screen (I have not deeply investigated this yet) is that it tends to trigger a lot of recompositions of the composables. I'm not sure why. In theory, the main thread at that point does nothing else than get this address from the wallet. I don't know that sending this work to a background thread should "speed it up" per se. I'm also not sure which part is actually the slowest part of this process. Is it the call to the Wallet object? Or the On my devices and emulators it's not very slow to load this address (as opposed to navigating to the screen itself, which tends to be a bit slow I find). |
I think generating the address is not a problem, but generating an image without thread switching will block the main thread. So what I am doing is, that I am calling the |
I will try to check if there are other recompositions in the mentioned screen, but I suppose generating the QR in the background should be a safe call. Although, it might be noticeable to me because my device is a slow potato >﹏<. |
Generating the image in the background is a good way to keep the UI from freezing, but I don't know how it can address your issue of the slowness of it directly. |
Yeah slow won't be an appropriate word here. I was referring to the delay it causes. |
f2.mp4
Fixes:
withContext(Dispatchers.IO)
and call the corresponding qr generation function there.firstissue.mp4
The text was updated successfully, but these errors were encountered: