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
Blocking UI thread on first initialization #3543
Comments
Do you have a systrace or profile screenshot which shows what's specifically to blame? I'm not sure what action we can take from this report. A lot of things have to happen on first use of Retrofit: classloading Retrofit, OkHttp, and Okio; initialization of OkHttp's thread pools; initialization of adapters and converters and classloading+initialization of their backing libraries; and parsing of the service interface annotations. It might simply be death by a thousand cuts, but without a reproducing sample application we can run or some kind of trace/profiler output I don't know that we can really offer anything. |
@ArcherEmiya05 as @JakeWharton said, a lot of computation is going on, also i would recommend initializing such heavy objects on application startup using Hilt as a dependency injection mechanism for example. |
I can confirm this issue is still reproducible. To reproduce it's very simple, just create a |
I am getting a lot of hiccups
Choreographer: Skipped 59 frames! The application may be doing too much work on its main thread.
during first initialization of Retrofit which is noticeable when switching between fragments using navigation drawer. It will be fixed if I add delay on making request but I want to know if there is any neat solution on this? I tried to use Kotshi as it was stated on the other issue that it performs well than Moshi but no luck.Home Fragment extending Parent Fragment
Parent Fragment
EndpointServices class with companion object function create(string,context)
The text was updated successfully, but these errors were encountered: