Skip to content

perf(android): Use generated manifest metadata - #5969

Open
romtsn wants to merge 5 commits into
mainfrom
perf/java-531-generated-manifest-metadata
Open

perf(android): Use generated manifest metadata#5969
romtsn wants to merge 5 commits into
mainfrom
perf/java-531-generated-manifest-metadata

Conversation

@romtsn

@romtsn romtsn commented Aug 14, 2026

Copy link
Copy Markdown
Member

📜 Description

Use manifest metadata injected by the Sentry Android Gradle plugin when available. The existing PackageManager Bundle remains the fallback, and all existing runtime option precedence remains unchanged.

💡 Motivation and Context

Reading ApplicationInfo metadata and converting every manifest option during startup showed up prominently in customer traces. The paired plugin change in getsentry/sentry-android-gradle-plugin#1405 resolves typed metadata from the final merged manifest and avoids that runtime work, reducing median SDK initialization time by 6.5% in the all-options benchmark.

💚 How did you test it?

Ran the ManifestMetadataReader release unit tests, including typed generated values, absent keys, auto-init, PackageManager fallback, and no Context access on the generated path. Also ran spotlessApply and apiDump.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Release with getsentry/sentry-android-gradle-plugin#1405 to enable the generated path.

Allow the Android Gradle plugin to provide authoritative manifest metadata so SDK initialization can skip PackageManager and Bundle unparceling. Read the injected map directly to avoid conversion overhead.

Refs JAVA-531
Co-Authored-By: Codex <noreply@openai.com>
@linear-code

linear-code Bot commented Aug 14, 2026

Copy link
Copy Markdown

JAVA-531

@sentry

sentry Bot commented Aug 14, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.53.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 319.29 ms 358.60 ms 39.32 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
fc5ccaf 270.49 ms 363.90 ms 93.41 ms
9d2f4e3 311.75 ms 357.80 ms 46.05 ms
694d587 312.37 ms 402.77 ms 90.41 ms
bb0ff41 317.76 ms 384.66 ms 66.90 ms
5b66efd 308.67 ms 363.85 ms 55.18 ms
c3ee041 310.64 ms 361.90 ms 51.26 ms
ad8da22 314.52 ms 352.47 ms 37.95 ms
44d18f5 334.50 ms 393.83 ms 59.33 ms
d15471f 303.49 ms 439.08 ms 135.59 ms
d15471f 342.08 ms 415.44 ms 73.35 ms

App size

Revision Plain With Sentry Diff
fc5ccaf 1.58 MiB 2.13 MiB 557.54 KiB
9d2f4e3 0 B 0 B 0 B
694d587 1.58 MiB 2.19 MiB 620.06 KiB
bb0ff41 0 B 0 B 0 B
5b66efd 1.58 MiB 2.13 MiB 559.07 KiB
c3ee041 0 B 0 B 0 B
ad8da22 1.58 MiB 2.29 MiB 719.83 KiB
44d18f5 0 B 0 B 0 B
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB

Previous results on branch: perf/java-531-generated-manifest-metadata

Startup times

Revision Plain With Sentry Diff
2385db7 377.33 ms 453.35 ms 76.02 ms
0b8acc4 292.31 ms 369.24 ms 76.93 ms
4da1e0e 315.68 ms 363.16 ms 47.48 ms
3037860 357.82 ms 424.16 ms 66.35 ms

App size

Revision Plain With Sentry Diff
2385db7 0 B 0 B 0 B
0b8acc4 0 B 0 B 0 B
4da1e0e 0 B 0 B 0 B
3037860 0 B 0 B 0 B

…ed-manifest-metadata

# Conflicts:
#	CHANGELOG.md
Use ManifestMetadataReader directly as the Gradle plugin injection target and remove the dedicated holder class.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@romtsn
romtsn force-pushed the perf/java-531-generated-manifest-metadata branch from 889ddc4 to ef70a24 Compare August 17, 2026 08:17
@romtsn
romtsn marked this pull request as ready for review August 17, 2026 10:18

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from the sentry-java side. i just had one thought but not sure how feasible it is.

Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from the sentry-java side. i just had one thought but not sure how feasible it is.

@romtsn romtsn added the sanity-check PR needs a lightweight review for obvious issues label Aug 17, 2026
Remove the device-specific benchmark percentage from the release note.

Co-Authored-By: Codex <noreply@openai.com>
@romtsn
romtsn enabled auto-merge (squash) August 17, 2026 12:58
@romtsn
romtsn disabled auto-merge August 17, 2026 13:34
@romtsn romtsn closed this Aug 17, 2026
@romtsn romtsn reopened this Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants