Skip to content

Commit c958fc6

Browse files
committed
Aleksey review
1 parent 020361d commit c958fc6

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

docs/topics/kotlin-daemon.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
[//]: # (title: Kotlin daemon)
22

3-
The Kotlin daemon is a background process that build systems can use to improve Kotlin compilation performance.
4-
The Kotlin daemon speeds up build times by keeping the compiler and its environment ready to compile. This approach
5-
avoids the overhead of starting a new Java Virtual Machine (JVM) instance and reinitializing the compiler for every
6-
compilation, leading to reduced build times for incremental builds or frequent small changes.
3+
The Kotlin daemon is a background process that build systems can use to improve build times by keeping the compiler
4+
and its environment ready to compile. This approach avoids starting a new Java Virtual Machine (JVM)
5+
instance and reinitializing the compiler for every compilation, leading to reduced build times for incremental builds
6+
or frequent small changes.
77

8-
Some build systems, like [Gradle](https://docs.gradle.org/current/userguide/gradle_daemon.html) and [Maven](https://maven.apache.org/tools/mvnd.html),
9-
have their own daemons that help reduce startup costs. However, they miss the added benefit that the Kotlin daemon
10-
completely isolates the build system process from the compiler. This separation is useful in dynamic environments where
11-
system settings might change at runtime.
8+
Some build systems have their own daemons that help reduce startup costs, such as the [Gradle daemon](https://docs.gradle.org/current/userguide/gradle_daemon.html) and the [Maven daemon](https://maven.apache.org/tools/mvnd.html).
9+
Using the Kotlin daemon instead reduces startup costs while also completely isolating the build system process from the compiler.
10+
This separation is useful in dynamic environments where system settings might change at runtime.
1211

1312
Although the Kotlin daemon has no direct user-facing interface, you can use it through build systems or the [build tools API](build-tools-api.md).
1413

@@ -46,10 +45,8 @@ For more information, see [`kotlin.daemon.jvmargs` property](gradle-compilation-
4645

4746
There are two common lifetime strategies for the Kotlin daemon:
4847

49-
* **Attached daemon**: Used when the client (like a build system) is long-running. The daemon shuts down shortly after the
50-
client process shuts down or the daemon hasn't been used for a while.
51-
* **Detached daemon**: Used when the client is short-lived (like command-line compilation). The daemon stays alive longer
52-
to await potential follow-up requests.
48+
* **Attached daemon**: Shut down the daemon shortly after the client process shuts down or the daemon hasn't been used for a while. Use when the client is long-running.
49+
* **Detached daemon**: Keep the daemon alive longer to await potential follow-up requests. Use when the client is short-lived.
5350

5451
To configure the lifetime strategy, you can use the following options:
5552

@@ -59,7 +56,7 @@ To configure the lifetime strategy, you can use the following options:
5956
| `autoshutdownUnusedSeconds` | How long a newly started daemon waits for a first client before shutting down if unused. | 1 minute |
6057
| `shutdownDelayMilliseconds` | How long the daemon waits to shut down after all clients disconnect. | 1 second |
6158

62-
To configure an attached daemon lifetime, set `autoshutdownIdleSeconds` to a **high** value and `shutdownDelayMilliseconds` to a **low** value.
59+
To configure an attached daemon lifetime strategy, set `autoshutdownIdleSeconds` to a **high** value and `shutdownDelayMilliseconds` to a **low** value.
6360

6461
<tabs group="build-system">
6562
<tab title="Gradle" group-key="gradle">
@@ -82,7 +79,7 @@ Use the following command:
8279
</tab>
8380
</tabs>
8481

85-
To configure a detached daemon lifetime, set `shutdownDelayMilliseconds` to a **high** value.
82+
To configure a detached daemon lifetime strategy, set `shutdownDelayMilliseconds` to a **high** value.
8683

8784
<tabs group="build-system">
8885
<tab title="Gradle" group-key="gradle">

0 commit comments

Comments
 (0)