Hello everyone,
has anyone noticed/documented Ktor slow response times in mobile clients, when using Ktor in KMM, compared to mainstream native libraries like Retrofit and Alamofire?
đź‘€ 2
c
CLOVIS
02/08/2023, 9:47 AM
I don't remember anyone mentioning anything like that here. Do you have some?
p
ptsiogas
02/08/2023, 9:55 AM
I am experimenting a little with the pokemon API call:
<https://pokeapi.co/api/v2/pokemon/ditto>
Currently I have created 2 functions, one performs the call through KMM-Ktor and the other through Native - Retrofit.
ptsiogas
02/14/2023, 2:45 PM
I am back from my benchmark to share my results:
My initial issue was that I was sending a header “Connection”, “Close” from the Ktor client. That was the issue for slow response times. Removing this header fixed the issue.
Eventually Ktor seems that can be totally compared with the native android client Retrofit and it’s response time was similar.