Move Okhttp client initialization to background thread.#2824
Conversation
|
Hello @Laimiux! Thanks for your contribution. Before moving forward, can you please tell what is the impact of the OkHttp initialization on the overall Datadog SDK initialization duration in your app? As I mentioned here, for our sample app running on emulator it is around 1%.
Yes, but this article talks about generic setup, so it is a generic advice. Datadog SDK have a specific setup which doesn't use cache. SDK indeed is using TLS, so |
I see it take about ~9% of total initialization. While the other areas are bigger, this one is easy to address.
|
|
Hello @Laimiux. Thanks for your contribution. Since we are using Gitlab CI, CI checks won't run from the forks, so I will pull your change and push it to the repo by myself and open a new PR. |
|
Closing in favour of #2829. |


What does this PR do?
Moving OkHttp Client initialization to the background thread.
Motivation
It's a standard practice to initialize the Okhttp client on the background thread. It's a pretty trivial thing to do since there already exists
Call.Factoryinterface.Additional Notes
#2809
Review checklist (to be filled by reviewers)