Skip to content

perf: compress synthetic-project.json to save disk space.#1743

Merged
autonomousapps merged 1 commit into
mainfrom
trobalik.disk-space
Jul 1, 2026
Merged

perf: compress synthetic-project.json to save disk space.#1743
autonomousapps merged 1 commit into
mainfrom
trobalik.disk-space

Conversation

@autonomousapps

Copy link
Copy Markdown
Owner

Partial resolution of #1604.

@autonomousapps autonomousapps merged commit 1b4cf8f into main Jul 1, 2026
1 check passed
@autonomousapps autonomousapps deleted the trobalik.disk-space branch July 1, 2026 17:59
@SimonMarquis

Copy link
Copy Markdown
Contributor

@autonomousapps FWIW here is a data point from our multi-module Android project:

From an clean project, running buildHealth, the total disk space usage is ~80 GiB.

~71% .json, 10% .bin, 5% .gz, 3% .jar, 3% .class, etc.

As an example, one of our largest feature module has a /build/reports/dependency-analysis at ~400MiB.

--- build/reports/dependency-analysis ------------------------------------
  146.9 MiB [#########################] /debugTest
  146.7 MiB [######################## ] /releaseTest
   49.2 MiB [########                 ] /debugMain
   49.0 MiB [########                 ] /releaseMain
    1.7 MiB [                         ]  usages-dependencies.json
    1.3 MiB [                         ]  unfiltered-advice.json
    1.3 MiB [                         ]  final-advice.json
   28.0 KiB [                         ]  declarations.json
   28.0 KiB [                         ]  bundled-traces.json
    4.0 KiB [                         ]  project-metadata.json
    4.0 KiB [                         ]  usages-annotation-processors.json
*Total disk usage: 396.1 MiB   Apparent size: 390.7 MiB   Items: 2,344

inside debugTest

--- build/reports/dependency-analysis/debugTest ------------------------
                                        /..
  120.1 MiB [#########################] /dependencies
   22.2 MiB [####                     ] /intermediates
    3.9 MiB [                         ] /graph
  716.0 KiB [                         ]  dependency-trace-report.json
    4.0 KiB [                         ]  android-score.json
*Total disk usage: 146.9 MiB   Apparent size: 145.1 MiB   Items: 821

and the largest item in dependencies is (unfortunately):

33.9 MiB [#########################]  com.android.tools.layoutlib__layoutlib__16.1.1.json

which is bundled in almost all our feature modules because we use it for screenshot testing.

Are there any other quick wins like gzipping that could be easily applied?

@autonomousapps

Copy link
Copy Markdown
Owner Author

There are two conceptually simple solutions to this issue.

  1. gzip every output
  2. centralize dependencies outputs (there's a lot of repetition)

I plan on taking the first step soon. Based on past results, I imagine this will have a significant positive impact on disk space usage.

Step 2, I've tried in the past, but ran into concurrent modification issues and parked the work. I'm sure it's doable; it's just that it needs to be prioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants