# Kotlin Script Slow Startup Performance

**URL:** <https://discuss.kotlinlang.org/t/kotlin-script-slow-startup-performance/15482>\
**Category:** Support\
**Created:** [December 17, 2019, 9:09pm UTC](https://discuss.kotlinlang.org/t/kotlin-script-slow-startup-performance/15482 "2019-12-17T21:09:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fkirc](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@fkirc](https://discuss.kotlinlang.org/u/fkirc)\
**Post date:** [December 17, 2019, 9:09pm UTC](https://discuss.kotlinlang.org/t/kotlin-script-slow-startup-performance/15482/1 "2019-12-17T21:09:17Z")

</div>

First of all, many thanks to the Kotlin team for bringing the JVM into a modern era of development.  
After migrating all my Android code to Kotlin, I tried to use Kotlin as a scripting language.  
I wrote a simple helloWorld.kts script:

> #!/usr/bin/env kotlinc -script  
> println(“Hello world”)

When running this script with kotlinc - script, I realized that the startup time is incredibly slow:

> time kotlinc -script helloWorld.kts  
> Hello world  
> real 0m2.417s

2.417 seconds to print hello world…  
It seems that most of this time is spent for compiling the Kotlin script.  
The following produces a HelloWorld.class without running the script:

> time kotlinc helloWorld.kts  
> real 0m2.499s

Moreover, If I use kotlin instead of kotlinc, then it does not work at all:

> kotlin helloWorld.kts  
> error: running Kotlin scripts is not yet supported

Compare this to Java:

> time sh -c ‘javac HelloWorld.java && java HelloWorld’  
> Hello world  
> real 0m0.433s

I use Ubuntu 18.04.  
I installed kotlinc with sudo snap install --classic kotlin.  
This yields:

> kotlinc -version  
> info: kotlinc-jvm 1.3.61 (JRE 1.8.0\_222-8u222-b10-1ubuntu1~18.04.1-b10)

This leads me to the questions:  
Did I miss a step to setup?  
What is the current state of Kotlin scripting support?  
Can we expect Kotlin to be a reasonable scripting language?
