autonomousapps / autonomousapps/dependency-analysis-gradle-plugin

Performance regression in 3.4.1

Open
#1,611 6 comments 0 reactions 0 assignees View on GitHub
more information needed performance
Dominant language
Kotlin
Stars
2.2k
Forks
158
Avg merge
16h 25m
Merged PRs (30d)
46

Description

**Gradle version**
9.2.1

**JDK version**
23

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

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

**Describe the bug**
I run a suite of static analysis checks on my project, and I noticed that clean runs have been taking longer than usual.

Doing profile builds with git bisect seem to show that updating DAGP from 3.3.0 to 3.4.1 is the culprit.

The issue only seems to surface when I run my full suite of static analysis checks; running `buildHealth` by itself doesn't seem to have an effect. My guess is that it's memory pressure related, but I didn't dig too deeply.

Using the task timing from Gradle scans I made this chart; the big offenders seem to be `AbiAnalysisTask`, `FindKotlinMagicTask`, and `ComputeAdviceTask` (total for 3.3.0 is 607.42s and for 3.4.1 is 665.13):

Task | 3.3.0 | 3.4.1 | Time Difference (%)
-- | -- | -- | --
SynthesizeDependenciesTask | 180.23 | 175.95 | -2.38%
ComputeUsagesTask | 84.62 | 96.59 | 14.14%
ExplodeJarTask | 74.41 | 76.99 | 3.48%
FindKotlinMagicTask | 16.31 | 55.68 | 241.39%
DiscoverClasspathDuplicationTask | 59.27 | 51.35 | -13.37%
AndroidScoreTask | 40.93 | 45.44 | 11.02%
ComputeAdviceTask | 12.23 | 27.42 | 124.24%
GraphViewTask | 25.81 | 19.38 | -24.91%
AbiAnalysisTask | 4.58 | 16.15 | 252.87%
ClassListExploderTask | 12.37 | 12.97 | 4.85%
SynthesizeProjectViewTask | 11.10 | 12.45 | 12.25%
FilterAdviceTask | 7.91 | 10.70 | 35.32%
AndroidCodeSourceExploderTask | 9.24 | 10.57 | 14.40%
ArtifactsReportTask | 13.55 | 8.61 | -36.42%
ManifestComponentsExtractionTask | 9.53 | 8.30 | -12.91%
XmlSourceExploderTask | 7.39 | 8.01 | 8.47%
FindServiceLoadersTask | 6.76 | 7.12 | 5.26%
FindAndroidResTask | 8.52 | 5.94 | -30.25%
AssetSourceExploderTask | 5.96 | 5.18 | -13.05%
FindAndroidLinters | 4.41 | 3.02 | -31.42%
FindAndroidAssetProviders | 5.05 | 2.72 | -46.14%
FindNativeLibsTask | 3.32 | 2.46 | -25.90%
FindDeclaredProcsTask | 2.45 | 1.23 | -49.69%
FindDeclarationsTask | 0.76 | 0.84 | 10.47%
GenerateBuildHealthTask | 0.73 | 0.04 | -94.00%
BuildHealthTask | 0.01 | 0.00 | -83.33%

I can share the Gradle scans privately (I have scans for 3.2.0, 3.3.0, 3.4.1, and 3.5.1)

Contributor guide

Open the contributing guide

Research direction

Reproduce clean runs with dependency-analysis-gradle-plugin 3.3.0 and 3.4.1 using the reported Gradle, JDK, Kotlin, and AGP versions, then profile the full static-analysis suite rather than buildHealth alone. Compare the timings for AbiAnalysisTask, FindKotlinMagicTask, and ComputeAdviceTask; done means identifying and resolving the regression with evidence from the available Gradle scans.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.