Ideas & Insights
The notion that “time flies when you’re having fun” is not just an expression we can all relate to, but it’s an important principle when strategizing on ways to improve individual and team work satisfaction and productivity. This idea was explored in depth in the popular book published originally back in 1990 called Flow: The Psychology of Optimal Experience (Mihaly Csikszentmihalyi). Here’s a favorite quote:
“When being completely involved in an activity for its own sake, the ego falls away. Time flies. Every action, movement, and thought follows inevitably from the previous one, like playing jazz. Your whole being is involved, and you're using your skills to the utmost.”
I also very much like what Cal Newport had to say more recently in DeepWork (2016) on a related theme:
“Professional activity performed in a state of distraction-free concentration that push your cognitive capabilities to their limit. These efforts create new value, improve your skill, and are hard to replicate.”
What do the principles of “flow” and “deep work” have to do with Developer Productivity Engineering (DPE)? The answer is pretty much everything. DPE acceleration technologies like Build Cache and Distributed Testing dramatically reduce build times. This avoids breaking your development flow with frequent context switching which happens when feedback cycles are too long and you are tempted to switch your focus to a different less-productive task while you wait for your build to complete. DPE also encourages deep work by not only minimizing idle wait time and context-switching costs, but also the time it takes to troubleshoot build failures using DPE tools like Build Scans and Failure Analytics. This ensures developers spend less time on tedious tasks like debugging broken builds and tests, and focus more on their passion—writing great code. But, it all starts with fast feedback cycles which you can learn more about here.
Expert Takes
I’ve come across quite a few different Android builds of all different sizes in my experience as an Android Engineer (Facebook, SoundCloud, Qualcomm, Coursera, ZenJob) as well as a Solutions Engineer at Gradle. The best piece of advice for scaling builds is of course to modularize your build, but aside from modularization, there are some other tips and tricks you can use to get the most out of your existing build.
Scaling Android builds is all about experimentation and measurement. The Android Gradle Plugin is really easy to use when starting a small project because all of its features are enabled by default. On the other hand, making large builds performant is all about turning all the feature switches off. To scale a build you need to get creative and turn off Android Gradle Plugin features that you do not use. Use gradle properties to disable unused Android Gradle Plugin features as well as other plugins for local developer builds.
Build flavors and build types can multiply configuration and execution times. Filter out flavors and variants which you do not use. On that note, when disabling things and reconfiguring build files, always measure improvements and changes using Build Scans or the Gradle Profiler. Don’t just guess! You can learn more tips and tricks from me and a panel of experts from a Google, Dropbox, Slack, Square in a droidcon Online 2020 Webinar I led entitled ”Not Just Another Modularization Talk—Scaling your Android Build with Gradle.
Technology News
Individual tools have unique strengths in addressing the needs and requirements of specific developer ecosystems. As a result, build tool specialization and fragmentation will continue to be the norm across and even within these ecosystems (e.g. Gradle and Maven). And while the Gradle build tool will likely continue to grow its already significant market share in the JVM ecosystem, Bazel is well-positioned to play a significant role in others (e.g. Angular).
With that said, Gradle engineers recently completed a detailed comparative analysis and evaluation of the suitability of Google’s Bazel build tool for usage within JVM environments before concluding that (1) despite Bazel’s strong and well-deserved reputation for performance and scalability, Gradle outperforms Bazel in almost every scenario tested; (2) optimizing projects for Bazel comes at a significant cost for build authoring and maintenance; and (3) Gradle provides more compelling features and conveniences for common use cases in JVM projects, including critical capabilities for dependency management and tool integration, while Bazel lacks support for basic capabilities expected from a JVM build tool.
In sum, while there is a lot of merit in Bazel’s approach—particularly for extremely large monorepos like the one at Google—the data and analysis indicates clearly that Gradle Build Tool is a better choice then Bazel for most JVM projects.
Featured Resource
Gradle has also recently published a new solution overview video entitled: “Gradle Enterprise Overview | Optimize Gradle & Maven Builds.” If you are going to watch one video about Gradle Enterprise and you have the time, watch this solution overview video. It provides the strategic context for investing in a Developer Productivity Engineering (DPE) initiative and a walkthrough (demo) of the major solution capabilities of Gradle Enterprise and their benefits. The addition of this new video is part of a broader recent effort by the Gradle Team to revamp its YouTube channel (tv.gradle.com). This has resulted in a lot of new content, including several new playlists organized by DPE benefit. They include:
Featured Upcoming Event
On this Thursday, July 16, Gradle will host a training where participants will learn the basics and best practices to make the most of caching in Maven builds. The training will cover the different possible architectures and how they affect build performance, as well as, how Gradle Enterprise can help with the management, analysis, and troubleshooting of the build cache. This is a 3-hour training session followed by 30-minutes Q&A. Maven build tool users, as well as Gradle Enterprise users interested in speeding up builds, are encouraged to attend the training. This course assumes a good understanding of the Java language and working knowledge of Maven. After this training the participants will be able to:
- Understand the benefits of using the Maven build cache
- Use and configure the build cache
- Optimize build logic for maximum cacheability
- Maximize the benefits of the build cache with Gradle Enterprise
|