is it reasonable to consider Kotlin/Native over Ru...
# kotlin-native
p
is it reasonable to consider Kotlin/Native over Rust when creating a performance-critical, but not real-time app? that is, reasonable GC pauses are allowed, but the thing overall should be performant like a native app. Are there any benchmarks for it?
👀 1
m
I would expect K/N to be considerably slower but curious about the answer too
p
to be more precise: think of a use case like linters, so short-living tools, contrary to long-living Web services where JVM and JIT make sense
a
short-living tools
If it's short-living enough and you're willing to ignore memory consumption, you can try disabling GC altogether: https://kotlinlang.org/docs/native-memory-manager.html#disable-garbage-collection Currently i's not our focus to keep this mode as performant as it can be, but at least it won't have any GC pauses.
👌 1
p
thanks! what kind of performance can I expect with GC disabled, roughly?
a
Don't know, sorry. We've never benchmarked this mode. Most likely it performs exactly like with the GC enabled minus all the pauses.
m
You also have the option to turn your short-lived process into a long-lived. This is what Gradle and the Kotlin compiler do with their daemons
If you're writing a linter for Kotlin things, I would go that route. Using the same language as the rest of the ecosystem has tremendous value
Maybe even AOT compile it with GraalVM (that'd be another interesting benchmark)
o
also, you could try to write it common kotlin (with minimal external dependencies if possible) and then compare performance of K/JVM, K/JVM+Graal and K/N (and even K/WASM? 🙂) it would be hard to compare Rust to K/N, as there is a big difference in how you manipulate data there (like having native structs support in Rust), which will affect both architecture of the app and overall what code you write. It’s possible to write micro-benchmarks, but as we all know, most of the time they are not so representative
.wasm 2
👍 2