`javac` compiles hello world program in 500ms, is ...
# announcements
v
javac
compiles hello world program in 500ms, is there a reason why does
kotlinc
takes 3 s? Is there any way I can improve this? I heard about kotlinc daemon but could not find any documents to get started.
g
are you using gradle?
v
I have, and the performance is at par with java - I know it runs a daemon. Can I get the same performance with
kotlinc
?
g
kotlin daemon is used only for Gradle
v
@gildor Do you know how come https://try.kotlinlang.org is so fast in compiling and running the code?
g
It uses compiler under the hood as a library. It's much faster because it's not starting each time and uses warmed JVM Do you have some particular use case?
v
I am implementing online editor. So far I have used gradle and getting 1.1 sec over http.
But gradle itself adds about .7 sec.
g
You can use exactly the same code, it’s open source https://github.com/JetBrains/kotlin-web-demo
v
Wow thanks for the link.
g
So far I have used gradle
If you use Gradle you probably should use Gradle tooling API and connect to gradle directly, not just run it from command line, otherwise you pay price of configuration time on every launch even with daemon
https://play.kotlinlang.org uses the same code, but just as web service, with own UI
v
Informational. Appreciate it. The only problem is that the server is in golang.
g
which one?
v
Does gradle provides rpc?
The service I am writing.
g
Tooling API is JVM
anyway, you don;t need it, because everything is already part of kotlin-web-demo project
you just run it and send http requests to compile and invoke your code
v
Got it