https://kotlinlang.org logo
Title
w

Wietlol

03/12/2022, 11:14 AM
Hi I am trying to fix some performance issues with Ktor's HttpClient with curl engine for Kotlin/Native but I am not sure how to proceed from here I noticed that the http calls to localhost take above 100ms, even though the server can respond in 2ms or less Reproducing the issue locally and running it a few times (even though I am using very primitive tools to measure the performance) shows that it does indeed run very slow https://paste.ofcode.org/GYkS6PnEjvjHn9U8Baw6eQ
expected: 11852
actual:   11850
average:  118.5
min:      105
max:      128
running similar code in Java (using a different http client though) results in the following
expected: 94
actual:   74
average:  0.74
min:      0
max:      25
How can I figure out where this overhead comes from? And how can I solve it?
my guess is that it probably has to do with async
after a bit more testing, I created an issue in the ktor youtrack
j

Júlio Santos

03/13/2022, 1:26 AM
Post the link here for us to follow, please