Parallelism And Daemon Performance
Making a build use the machine it runs on: parallel project execution, worker limits, project isolation, and a warm daemon. Interviewers ask because these settings are cheap to change and usually untouched.
on this pageshowhide
explore
- Parallel Project Execution5 questions
- Worker Count And Worker API5 questions
- Project Isolation5 questions
- Daemon Reuse For Speed5 questions
- JVM Warmup And Daemon Heap5 questions
- Configuration On Demand5 questions
- File System Watching (VFS)5 questions
questions
page 2 of 2Mechanically, how does a retained VFS speed up Gradle's up-to-date checks compared with a cold snapshot?
basics
~20 sUp-to-date checks compare current input/output hashes to the last build's. A cold VFS re-stats and re-hashes every input; a retained VFS reuses cached hashes for unchanged files and only re-snapshots paths the OS reported changed.
You enabled file system watching but warm builds aren't faster and you see 'retained 0 files' — how do you systematically troubleshoot it?
basics
~20 sConfirm the daemon is reused (stable JVM args, not --no-daemon), the workspace is on a local supported filesystem, and on Linux the inotify quota is high enough. Use org.gradle.vfs.verbose to see retained vs. invalidated counts.
What performance benefits does Project Isolation deliver, and what are the trade-offs of adopting it today?
basics
~10 sIt speeds up large multi-project builds via parallel and incremental configuration, so only changed projects reconfigure. The trade-off: it's incubating, needs cross-project access removed, and not all plugins are compatible.
Explain how HotSpot's tiered JIT compilation produces the warmup curve a Gradle daemon experiences, and why a long-lived daemon eventually reaches peak throughput.
basics
~10 sHotSpot first interprets, then C1-compiles hot methods quickly, gathers profiles, and finally C2-compiles the hottest methods to highly optimized code. Over several builds the daemon converges on this fast C2 code, reaching peak speed.
How would you choose a value for org.gradle.workers.max for a memory-heavy multi-module build, and how do you validate the choice empirically?
basics
~20 sStart near the core count, but cap it so workers × per-fork/daemon heap fits available RAM. Then sweep a few values (e.g. 2/4/6/8), measure wall-time and GC/OOM with build scans, and keep the smallest value that gives near-peak speed.
showing 31–35 of 35