diff options
| author | iniklyaev <[email protected]> | 2026-06-29 23:43:27 +0300 |
|---|---|---|
| committer | iniklyaev <[email protected]> | 2026-06-30 00:08:25 +0300 |
| commit | 66d0c52de24f9482c50a1efa2596824b7f635504 (patch) | |
| tree | 57e04215b2fa6c4c92d08a3cb17b055892590920 /contrib/tools/python3/Python/fileutils.c | |
| parent | 7c060855057124b38485e672117d51a185b0cc9b (diff) | |
Javac/kotlinc daemon [AI generated]
**Persistent javac/kotlinc compilation daemon for `ya make` (opt-in)**
**Note:** the code in this PR was generated mostly by an LLM.
This PR adds an opt-in persistent compilation daemon that runs `javac` and `kotlinc` in-process inside a long-lived JVM, instead of spawning a fresh subprocess per build node. Each Java/Kotlin module today pays the full JVM \+ compiler startup cost (\~150–340 ms of startup, plus \~55 MB of kotlinc class-loading) on every node, which dominates the wall time of short compiles; amortizing that startup across all nodes in a build session yields measurable speedups (1.3x–3.7x CPU economy on the benchmarked targets, with zero correctness fallbacks or failed nodes).
The daemon (`devtools/buildstep_tools/javac_daemon`, a `JAVA_PROGRAM` built to a committed `JavacDaemon.jar`) listens on a Unix domain socket and runs both compilers concurrently; a thin Python client in the existing build scripts (`javac_daemon_client.py`, wired into `run_javac.py` / `compile_java.py` via `build/conf/java.conf`) decides per-node eligibility, routes launcher flags, selects/launches the right daemon instance, and **always falls back to a plain subprocess** on any doubt (old JDK, resource JVM flag, denied annotation processor, daemon error), so build correctness never depends on the daemon. The feature is **off by default** and activated only via `YA_JAVAC_DAEMON=1` passed to `ya make`; without it the build uses the existing subprocess path unchanged.
See `junk/iniklyaev/javac-daemon/DESIGN_javac_daemon.md` for the full design, flag-routing rules, fault-isolation model, and benchmark methodology.
commit_hash:f4e07c5bb51064e0bc24539348e01a85ff63a835
Diffstat (limited to 'contrib/tools/python3/Python/fileutils.c')
0 files changed, 0 insertions, 0 deletions
