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
ktor-client performance #1509
Comments
How did you test it? According to ours test cio worked faster |
@cy6erGn0m Test code with results and how to run is at https://github.com/brendanw/profilehttp Ktor server is setup here https://github.com/brendanw/profilehttp/blob/master/server/src/main/kotlin/main.kt Ktor client with cio engine is setup here Okhttp client is setup here Here's the ktor client configuration
|
@cy6erGn0m Would it be possible to publish your guys' tests? That might be a quicker way to allow me to figure out what we are doing differently and see if it is an error on my end. |
We have some benchmarks in our repo: https://github.com/ktorio/ktor/tree/master/ktor-client/ktor-client-benchmarks. Could you make the PR with the sample? |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
We see similar performance issues with ktor client using CIO. In our system tests we were using the ktor client, but with CIO the whole test took 30 - 40 seconds. But after switching it to OkHttp it ran in about 6 - 7 seconds. When I'm running the official benchmarks I also see that CIO is much slower right now:
ps. We recently upgraded to Kotlin 1.4. And I'm running on macOS right now. |
Subsystem
ktor-client-cio:1.2.6
https://github.com/brendanw/profilehttp
Code uses both ktor client and server. I am specifically testing the cio engine.
Is your feature request related to a problem? Please describe.
I am expecting the ktor client to have similar performance to okhttp. I am seeing worse performance from the ktor client in each benchmark so far.
Describe the solution you'd like
I'd like feedback on if I am configuring the client in an unfair way or if there is a way I should restructure the benchmarks that would make for a more fair comparison.
Motivation to include to ktor
I'd like to switch to use the CIO engine with the ktor client on android as the one thread per request model seems wasteful.
The text was updated successfully, but these errors were encountered: