Gradle 3.0: Unleash the Daemon!
-
Upload
eric-wendelin -
Category
Engineering
-
view
802 -
download
3
Transcript of Gradle 3.0: Unleash the Daemon!
Gradle SummitGradle 3.0: Unleash the Daemon!
Eric Wendelin
2016
Eric Wendelin@eriwen
Long-lived Background Process
Client/Server communicating over TCP locally
Listens for and executes Build Actions
Daemon in a nutshell
Daemonstration
2nd build typically 15-75% faster
faster the more
you use it
Progressive runtime optimizations
Higher class cache hit rate
More effective task I/O caching
"Discovered the beauty of the
@gradle daemon, and now reaping the
benefits of sub-second builds"
@tylerjharden
"Enabling the #gradle daemon took
my build from 13s to 1.1s. This should
be the default."
@GDBolinger
5th build typically 30-90% faster
Smokin'
fast!
Daemon in Gradle 3.0
Daemon in Gradle 3.0
Enabled by default
Resource-aware
More robust, especially on Windows
Better UX
Integrated with Gradle Build Scans
Daemon in Gradle 3.0
Enabled by default
Resource-aware
More robust, especially on Windows
Better UX
Integrated with Gradle Build Scans
--daemon
org.gradle.daemon=true
Daemon in Gradle 3.0
Enabled by default
Resource-aware
More robust, especially on Windows
Better UX
Integrated with Gradle Build Scans
Resource Awareness
System Memory
Daemon JVM Memory
GC Activity
Other Daemons
What we've built is a framework for making the Daemon more intelligent
Daemon in Gradle 3.0
Enabled by default
Resource-aware
More robust, especially on Windows
Better UX
Integrated with Gradle Build Scans
GRADLE-3018*
GRADLE-3481*
GRADLE-2803
GRADLE-3265
GRADLE-3315
GRADLE-2828
GRADLE-2275*
GRADLE-2415
GRADLE-2629
GRADLE-2367
GRADLE-2273
GRADLE-2271
Reasons not to use the Daemon
* In Progress
Daemon in Gradle 3.0
Enabled by default
Resource-aware
More robust, especially on Windows
Better UX
Integrated with Gradle Build Scans
Better UX
Daemon in Gradle 3.0
Enabled by default
Resource-aware
More robust, especially on Windows
Better UX
Integrated with Gradle Build Scans
Gradle Build Scans
Everyday Daemon Use
When should I use the Daemon?
All projects, everywhereexcept possibly CI
Daemon in IDEs
All IDEs always use the Daemon through the Gradle Tooling API
Reusing Daemons across projects
Same Gradle version
Same $JAVA_HOME
Compatible JVM Args
How do I score one of those sweet,
rare Gradlephant transfer stickers?
Bribery
Maximizing
Performance
Effective Daemon Reuse
gradle --status
gradle --info shows Daemon stopped reasons
org.gradle.daemon.idletimeout
Daemon Performance Logging
org.gradle.daemon.performance.logging=true
~/.gradle/daemon/$VERSION/daemon-$PID.out.log
Daemon Performance Tuning
org.gradle.daemon. performance.tenured-usage-expire-at=90
org.gradle.daemon. performance.tenured-rate-expire-at=1.2
org.gradle.daemon. performance.permgen-usage-expire-at=80
~/.gradle/daemon/$VERSION/daemon-$PID.out.log
Build slow, even with Daemon?
Gradle Build Scans to the rescue
gradle.github.io/performance-guide
Gradle Performance Guide
None of these?
News Flash: You're at the freakin' Gradle Summit
Tweet @gradle
discuss.gradle.org
None of these?
Maximizing Performance
Reuse Daemon as much as possible
Use Build Scans
Gradle Performance Guide
discuss.gradle.org
Beyond Gradle 3.0
Beyond Gradle 3.0
Cross-version Daemon Registry
More intelligent caching
Better cache eviction for longer-running Daemons
Beyond Gradle 3.0
Warms itself up while idle
Automatically adjusts for user behavior through machine learning
Speculative dependency resolution and execution
The Daemon is the vehicle through which Gradle can
become proactive
two more things...
Try it today
gradle wrapper --gradle-version 3.0-milestone-2
Give feedback
discuss.gradle.org
gradle.org/jobs
Have ideas?
@eriwen
Thank You
@mbarnath@ghhale @lhotariEric Wendelin and the Daemon Team
Learn more at www.gradle.org