Command line compile generates large jar with -include-runtime

First, I am completely new to java and Kotlin, so I am sure I honked something up with my setup.

I already had VS Code installed, so I went with directions around installs that used VS Code.

My first compile was just a hello world, and the compile time was right around 60s, and generated a jar file that was well over 4 MB. When I added -no-reflect to the command line compile it got the build time down to ~20s with a ~1.5 MB jar.

Now my PC isn’t exactly top of the line, but it isn’t a potato either, and the tutorial videos I saw showed ~2s compile times. I figure I am missing something in how I set things up.

I followed setup for VS Code and java/kotlin from this link.

Is a 60s compile with a mid-end PC, resulting in a 4.5 MB jar file normal when using -include-runtime?

I realize what I have provided isn’t much to go on, but any help or recommendations would be appreciated.

People usually do not use kotlinc directly. But together with reflection and kotlin stdlib, 4 MB is a normal size. It could be reduced with DCE tools like R8 or ProGuard, but it is normal.

As for compilation speed, the run itself is pretty fast if your JVM is already started (if you do that the second time on a running daemon), but if you do the so-called “cold start”, then it could take more time.

Thanks for the reply, I appreciate it.