# How is the Kotlin Playground so fast?

**URL:** <https://discuss.kotlinlang.org/t/how-is-the-kotlin-playground-so-fast/17484>\
**Category:** Language Design\
**Created:** [May 4, 2020, 12:29pm UTC](https://discuss.kotlinlang.org/t/how-is-the-kotlin-playground-so-fast/17484 "2020-05-04T12:29:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lapi\_man](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@lapi\_man](https://discuss.kotlinlang.org/u/lapi_man)\
**Post date:** [May 4, 2020, 12:29pm UTC](https://discuss.kotlinlang.org/t/how-is-the-kotlin-playground-so-fast/17484/1 "2020-05-04T12:29:57Z")

</div>

I’m comparing the speed of a hello world example running locally and on kotlin playground:

```
import java.io.*;
import java.util.*;

fun main(args: Array<String>) {
  for (i in 1..10) println("Hello, World!")
}

```

Running it on [https://play.kotlinlang.org](https://play.kotlinlang.org) takes around 1.5 seconds  
Compiling it locally with kotlinc (1.3.31) and running the jar with java 11 takes around 7 seconds

How is it possible that the playground is so much faster? Is it only the hardware?  
thanks

---

<div class="post-metadata">

**Author:** ![fatjoe79](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/fatjoe79/32/4221_2.png) [@fatjoe79](https://discuss.kotlinlang.org/u/fatjoe79)\
**Post date:** [May 4, 2020, 12:47pm UTC](https://discuss.kotlinlang.org/t/how-is-the-kotlin-playground-so-fast/17484/2 "2020-05-04T12:47:29Z")

</div>

The Kotlin compiler can run as a deamon, which it probably does on Kotlin playground. This removes the time costs of starting up the compiler.

---

<div class="post-metadata">

**Author:** ![darksnake](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/darksnake/32/2479_2.png) [@darksnake](https://discuss.kotlinlang.org/u/darksnake)\
**Post date:** [May 4, 2020, 2:46pm UTC](https://discuss.kotlinlang.org/t/how-is-the-kotlin-playground-so-fast/17484/3 "2020-05-04T14:46:22Z")

</div>

Also in order to run application you need to startup JVM two times: one for compile and one for run.
