Gradle Build Performance
Debug and optimize Android/Gradle build performance.
Install
npx skills add new-silvermoon/awesome-android-agent-skills --skill gradle-build-performance -g -a claude-code -y- Repository
- new-silvermoon/awesome-android-agent-skills998
- Category
- Testing
- Updated
- 3mo ago
- License
- Apache-2.0
- Context cost
- Mediumabout 1,976 tokens
- Runs scripts
- No, instructions only
What it does
Debug and optimize Android/Gradle build performance. Use when builds are slow, investigating CI/CD performance, analyzing build scans, or identifying compilation bottlenecks.
Gradle Build Performance
When to Use
- Build times are slow (clean or incremental)
- Investigating build performance regressions
- Analyzing Gradle Build Scans
- Identifying configuration vs execution bottlenecks
- Optimizing CI/CD build times
- Enabling Gradle Configuration Cache
- Reducing unnecessary recompilation
- Debugging kapt/KSP annotation processing
Example Prompts
- "My builds are slow, how can I speed them up?"
- "How do I analyze a Gradle build scan?"
- "Why is configuration taking so long?"
- "Why does my project always recompile everything?"
- "How do I enable configuration cache?"
- "Why is kapt so slow?"
Workflow
- Measure Baseline, Clean build + incremental build times
- Generate Build Scan,
./gradlew assembleDebug --scan - Identify Phase, Configuration? Execution? Dependency resolution?
- Apply ONE optimization, Don't batch changes
- Measure Improvement, Compare against baseline
- Verify in Build Scan, Visual confirmation
Quick Diagnostics
Generate Build Scan
./gradlew assembleDebug --scan
Profile Build Locally
./gradlew assembleDebug --profile
# Opens report in build/reports/profile/
Build Timing Summary
./gradlew assembleDebug --info | grep -E "^\:.*"
# Or view in Android Studio: Build > Analyze APK Build
Build Phases
| Phase | What Happens | Common Issues |
|---|---|---|
| Initialization | settings.gradle.kts evaluated | Too many include() statements |
| Configuration | All build.gradle.kts files evaluated | Expensive plugins, eager task creation |
| Execution | Tasks run based on inputs/outputs | Cache misses, non-incremental tasks |
Identify the Bottleneck
Build scan → Performance → Build timeline


