autonomousapps / autonomousapps/dependency-analysis-gradle-plugin

GraphVisitor.usesResByRes is extremely slow. (Stuck in computeActualUsageDebug for many minutes)

Open
#1,186 18 comments 0 reactions 0 assignees View on GitHub
performance sponsorable toolchain:android
Dominant language
Kotlin
Stars
2.2k
Forks
158
Avg merge
16h 25m
Merged PRs (30d)
46

Description

**Build scan link**

**Plugin version**
1.31.0

**Gradle version**
8.6

**JDK version**
21.0.2 (BellSoft 21.0.2+14-LTS)

**(Optional) Kotlin and Kotlin Gradle Plugin (KGP) version**
1.9.23

**(Optional) Android Gradle Plugin (AGP) version**
8.3.2

**Describe the bug**
The task `computeActualUsageDebug` gets stuck for a long time.
This module contains only android resources(images, vector drawables, translations and theme definitions), no code, so I don't understand why it takes so long. It has around 250 files on it and it takes around 5-10 min to run in a M1 machine doing no other heavy compilation.
The same task in other big modules with lots of code and dependencies takes way less time. I checked the memory usage in the gradle daemon and it seemed fine (not a lot of GCs happening).

Is there any debug flag I could pass to the build that could give me infos about what is happening?

**Expected behavior**
To run the analysis faster?

**Additional context**
My `gradle.properties` has, if I remove this flag, `computeActualUsageRelease` also gets stuck.
dependency.analysis.android.ignored.variants=release

Contributor guide

Open the contributing guide

Research direction

Reproduce the delay by running computeActualUsageDebug on the resource-only module described in the issue, with dependency.analysis.android.ignored.variants=release in gradle.properties. Start by tracing GraphVisitor.usesResByRes and computeActualUsageDebug, then compare the behavior with the other modules mentioned. Done means the analysis completes substantially faster without changing the reported resource coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
build-system, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.