Gradle 3.0: Unleash the Daemon!

780 views

Published on

What's new with the Gradle Daemon in Gradle 3.0, how to maximize performance with the Gradle Daemon, and where it will be going in the future. Presented at the Gradle Summit 2016.

Published in: Engineering

Gradle 3.0: Unleash the Daemon!

  1. 1. Gradle Summit Gradle 3.0: Unleash the Daemon! Eric Wendelin 2016
  2. 2. Eric Wendelin @eriwen
  3. 3. Long-lived Background Process Client/Server communicating over TCP locally Listens for and executes Build Actions Daemon in a nutshell
  4. 4. Daemonstration
  5. 5. 2nd build typically 15-75% faster
  6. 6. faster the more you use it Progressive runtime optimizations Higher class cache hit rate More effective task I/O caching
  7. 7. "Discovered the beauty of the
 @gradle daemon, and now reaping the benefits of sub-second builds" @tylerjharden
  8. 8. "Enabling the #gradle daemon took
 my build from 13s to 1.1s. This should
 be the default." @GDBolinger
  9. 9. 5th build typically 30-90% faster
  10. 10. Smokin' fast!
  11. 11. Daemon in Gradle 3.0
  12. 12. Daemon in Gradle 3.0 Enabled by default Resource-aware More robust, especially on Windows Better UX Integrated with Gradle Build Scans
  13. 13. Daemon in Gradle 3.0 Enabled by default Resource-aware More robust, especially on Windows Better UX Integrated with Gradle Build Scans
  14. 14. --daemon org.gradle.daemon=true
  15. 15. Daemon in Gradle 3.0 Enabled by default Resource-aware More robust, especially on Windows Better UX Integrated with Gradle Build Scans
  16. 16. Resource Awareness System Memory Daemon JVM Memory GC Activity Other Daemons
  17. 17. What we've built is a framework for making the Daemon more intelligent
  18. 18. Daemon in Gradle 3.0 Enabled by default Resource-aware More robust, especially on Windows Better UX Integrated with Gradle Build Scans
  19. 19. 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
  20. 20. Daemon in Gradle 3.0 Enabled by default Resource-aware More robust, especially on Windows Better UX Integrated with Gradle Build Scans
  21. 21. Better UX
  22. 22. Daemon in Gradle 3.0 Enabled by default Resource-aware More robust, especially on Windows Better UX Integrated with Gradle Build Scans
  23. 23. Gradle Build Scans
  24. 24. Everyday Daemon Use
  25. 25. When should I use the Daemon? All projects, everywhere
 except possibly CI
  26. 26. Daemon in IDEs All IDEs always use the Daemon
 through the Gradle Tooling API
  27. 27. Reusing Daemons across projects Same Gradle version Same $JAVA_HOME Compatible JVM Args
  28. 28. How do I score one of those sweet, rare Gradlephant transfer stickers? Bribery
  29. 29. Maximizing Performance
  30. 30. Effective Daemon Reuse gradle --status gradle --info shows Daemon stopped reasons org.gradle.daemon.idletimeout
  31. 31. Daemon Performance Logging org.gradle.daemon.performance.logging=true ~/.gradle/daemon/$VERSION/daemon-$PID.out.log
  32. 32. 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
  33. 33. Build slow, even with Daemon? Gradle Build Scans to the rescue
  34. 34. gradle.github.io/performance-guide Gradle Performance Guide
  35. 35. None of these?
  36. 36. News Flash: You're at the freakin' Gradle Summit Tweet @gradle discuss.gradle.org None of these?
  37. 37. Maximizing Performance Reuse Daemon as much as possible Use Build Scans Gradle Performance Guide discuss.gradle.org
  38. 38. Beyond Gradle 3.0
  39. 39. Beyond Gradle 3.0 Cross-version Daemon Registry More intelligent caching Better cache eviction for longer-running Daemons
  40. 40. Beyond Gradle 3.0 Warms itself up while idle Automatically adjusts for user behavior through machine learning Speculative dependency resolution and execution
  41. 41. The Daemon is the vehicle through which Gradle can become proactive
  42. 42. two more things...
  43. 43. Try it today gradle wrapper 
 --gradle-version 3.0-milestone-2
  44. 44. Give feedback discuss.gradle.org
  45. 45. gradle.org/jobs Have ideas?
  46. 46. @eriwen Thank You @mbarnath@ghhale @lhotari Eric Wendelin and the Daemon Team
  47. 47. Learn more at www.gradle.org

×