Gradle
▶Optimize your CI pipeline
Professionally produced video — well-shot, well-edited, high-quality audio — from the Gradle folks.
Key takeaway point for me:
We don't have any complex trigger rules at CI. Any commit triggers the entire pipeline with all of those 20.000 tests. But any given change is unlikely to run all of those because we are using the build cache to avoid doing things like executing tests on a component which has not changed.
Improving the Performance of Gradle Builds
Learn how to identify performance issues with build scans and how to address several areas of you build which may impact performance:
- Parallel execution
- Configuration
- Dependency resolution
- Build cache
Stop rerunning your tests
Great rant by @StefanOehme about tests rerun.
Test rerun is the ultimate time waster. Gradle helps you avoid this cost with its build cache and incremental build features. It knows when any of your test inputs, like your code, your dependencies or system properties, have changed. If everything stays the same, Gradle will skip the test run, saving you a lot of time.
Android / iOS
▶ Speeding Up Your Android Gradle Builds (Google I/O '17)
Companion blog post, Optimize your build speed, tips:
- Keep your tools up to date
- Create a build variant for development
- Avoid compiling unnecessary resources
- Disable Crashlytics for your debug builds
- Use static build config values with your debug build
- Use static dependency versions
- Enable offline mode
- Enable configuration on demand
- Create library modules
- Create tasks for custom build logic
- Convert images to WebP
- Disable PNG crunching
- Enable Instant Run
- Disable annotation processors
- Profile your build
Most of these tips, although belonging to the Android world, deal on two main topics. Avoid doing work during configuration phase, leverage build cache.
Misc
Understanding Browser HTTP Accept Headers
Ever wonder what such a value for the Http Header Accept
really means:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
@KrisJordan explains it perfectly.
An Introduction to ThreadLocal in Java
Last week, I was going into the underworld of Java.
The
ThreadLocal
construct from thejava.lang package
gives us the ability to store data individually for the current thread – and simply wrap it within a special type of object.
Comment
Thanks for the feedback and for submitting issues after the Micronaut RC1 release. RC2 will be released early next week. Thus, 1.0.0. stable is around the corner.
This week, I talk about Gradle performance tips and some miscellaneous topics I have encountered.
Sergio del Amo