I've noticed that in this test https://www.techempower.com/benchmarks/#section=data-r15&hw=ph&test=plaintext ktor result are pretty bad compared to Rapidoid, Vertx, Netty.
Here's source code of this benchmark:
https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Kotlin/ktor/src/main/kotlin/org/jetbrains/ktor/benchmarks/Hello.kt
Is Ktor really that slow or there is some problem in benchmark?
That benchmark looks better for Ktor:
https://github.com/orangy/http-benchmarks
Based on my usage (which isn't ultra heavy load) is that it performs very well. Benchmarks are, well just that.
Not sure about the plaintext, I would expect that to be a little better - but Ktor is still young.
As for the database test it performs pretty well, but looking at the benchmark code - I'm not sure the tester understands how to use coroutines effectively (one of the main features of coroutines is that they are ultra lightweight threads and they work across threads with much less overhead). Similar to ForkJoin JSR.
One of the Ktor dev's here could probably get that benchmark code much faster.
In performance-heavy cases Ktor performes really well. It actually allowed us to use weaker machines and by extension to save money :) (Shout-out to Exposed as well).
I have been reading ktor code, and I am impressed, to say the least, though I am no expert by any stretch. It tries to use lockless and coroutines whereever possible.
This issue has been automatically marked as stale because it has not had recent activity.
How does the performance fair now?
This issue has been automatically marked as stale because it has not had recent activity.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Hey, the Ktor version was outdated there. We just updated TFB benchmarks to Ktor 1.4.0, and we're going to check performance in real-life scenarios in future releases.
Thanks for paying attention to that problem.
Most helpful comment
Based on my usage (which isn't ultra heavy load) is that it performs very well. Benchmarks are, well just that.
Not sure about the plaintext, I would expect that to be a little better - but Ktor is still young.
As for the database test it performs pretty well, but looking at the benchmark code - I'm not sure the tester understands how to use coroutines effectively (one of the main features of coroutines is that they are ultra lightweight threads and they work across threads with much less overhead). Similar to ForkJoin JSR.
One of the Ktor dev's here could probably get that benchmark code much faster.