Kotlin hotswap significatly slower than java
unsure if this is a bug or a limitation of kotlin
Java
Kotlin
experiencing same issue
Do you have a sample project that I can use to test it?
I made a basic Minecraft 1.21.4 frabic mod to showcase it. Classes RendererKotlin.kt and RendererJava.java were used for the test hotswapping with identical changes being made to them. I was using SingleHotswap 2.10, Intellij Community Edition 2025.1, Kotlin 2.2.0, Java 21, Windows 10 system, i5 11400 CPU.
https://github.com/AquaMinerale2b2t/example
While the speed detriment is apparant in my testing, the issue seems to be dramatically exacerbated in large projects, with copile times for a single class sometimes exceeding 40 seconds. Let me know if you need different samples to conduct your testing.
I made a basic Minecraft 1.21.4 frabic mod to showcase it. Classes
RendererKotlin.ktandRendererJava.javawere used for the test hotswapping with identical changes being made to them. I was using SingleHotswap 2.10, Intellij Community Edition 2025.1, Kotlin 2.2.0, Java 21, Windows 10 system, i5 11400 CPU.https://github.com/AquaMinerale2b2t/example
While the speed detriment is apparant in my testing, the issue seems to be dramatically exacerbated in large projects, with copile times for a single class sometimes exceeding 40 seconds. Let me know if you need different samples to conduct your testing.
Thanks a lot! But I think your project is set to private 😅
Oops! Should be fixed now
Sorry for the long wait. I spent some time implementing a custom Kotlin compiler in the plugin, but I couldn’t make it run any faster. My implementation calls the Kotlin compiler directly with the files you want to hotswap, and even then, it was still insanely slow.
Even a simple compile test in the console shows a huge difference:
I don't really know how to improve it...
You can try if it works for you singlehotswap.zip
While the speed detriment is apparant in my testing, the issue seems to be dramatically exacerbated in large projects, with copile times for a single class sometimes exceeding 40 seconds. Let me know if you need different samples to conduct your testing.