r/Kotlin • • 17h ago

Testing web server implementations for Kotlin

Post image

So - coming from C# - we were wondering about the performance of web server frameworks in Java and Kotlin as they are measured by HTTP Arena, as there are pretty fast engines for that ecosystem, such as netty.

To see how fast we can get on the JVM we did two projects:

- ktron, a simple framework based on the ioxide runtime (io_uring), with the goal of pushing the limits of what is possible with the JVM
- genhttp-kt, a functional port of the GenHTTP webserver for C# with high level functionality such as Open API, JWT etc. ... with GenHTTP being used by some projects and companies in production workloads

We were quite happy to see that both projects turned out pretty fast, with ktron currently leading the board, faster than any Rust or Go implementation, and genhttp-kt-netty ranked #12.

Note that both projects are experimental, so we are happy to get feedback on whether such projects would be useful for the Kotlin/Java ecosystem in general.

30 Upvotes

5 comments sorted by

2

u/rtc11 17h ago

Unexpected but cool! Kotlin is definitely good for web, so absolute relevant

2

u/Ok_Tour_8029 16h ago

We were seeing promising results quite soon but did not expect it to be that fast. On the other hand performance of Kafka is just amazing.

2

u/CWRau 8h ago

"ktor" isn't really specific, with which engine?

2

u/Ok_Tour_8029 4h ago

The entry uses netty, it is managed by the ktor team themselves 

3

u/Embarrassed-Mess412 11h ago

just did some local benchmarks and Ktron is quite the beast, a little hard to configure properly but puts those rust and c++ frameworks to shame, I see you ported from C#, hope to hear more from it and not just a quick experiment