https://kotlinlang.org logo
Title
o

Oleg Yukhnevich

09/17/2020, 6:33 PM
@e5l will performance of native ktor-io will be improved sometime in near future ? Now it's ~ 10 times slower than on jvm Or do you know, is it related to slow native runtime, or because of heavy atomics usage on native, or smth else?
j

Jolas

09/18/2020, 4:50 AM
@Oleg Yukhnevich do you have stats backing your statement “10 times slower than on JVM” ?
e

e5l

09/18/2020, 7:05 AM
Hey @Oleg Yukhnevich, let's investigate the problem. Could you create YT issue attaching your benchmarks? It also would be nice to check if you're running kotlin-native in the
Release
mode to turn on optimizations.
o

Oleg Yukhnevich

09/18/2020, 9:16 AM
Ok, I will create Issue with benchmarks soon
:tnx: 1
YT issue: https://youtrack.jetbrains.com/issue/KTOR-1049 benchmark: https://github.com/rsocket/rsocket-kotlin/blob/ktor-io-benchmarks/benchmarks-io/src/commonMain/kotlin/Frames.kt Raw results: JVM vs JS - writing is 2-3 times slower on JS, reading is 5-6 times slower on JS JVM vs Native(Release) - writing is 40+ times slower on Native, reading is 100+ times slower on Native
benchmark measures execution of 2 functions, one is just reading and creating an object, another is just building a packet