Skip to content

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

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

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

Conversation

@romtsn

@romtsn romtsn commented Aug 18, 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.

This replaces #5969, which was closed because GitHub retained a stale hidden conversation requirement.

💡 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.

romtsn and others added 5 commits August 14, 2026 12:05
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>
…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>
Remove the device-specific benchmark percentage from the release note.

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

linear-code Bot commented Aug 18, 2026

Copy link
Copy Markdown

JAVA-531

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 316.76 ms 385.04 ms 68.28 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
fc5ccaf 279.11 ms 353.34 ms 74.23 ms
96eeafa 361.43 ms 455.07 ms 93.63 ms
44472da 324.77 ms 360.60 ms 35.83 ms
694d587 305.45 ms 378.38 ms 72.94 ms
694d587 379.62 ms 400.80 ms 21.18 ms
bb0ff41 321.00 ms 378.28 ms 57.28 ms
0d66c0b 327.83 ms 403.40 ms 75.57 ms
e2dce0b 308.96 ms 360.10 ms 51.14 ms
ce0a49e 532.00 ms 609.96 ms 77.96 ms
ad8da22 365.86 ms 427.00 ms 61.14 ms

App size

Revision Plain With Sentry Diff
fc5ccaf 1.58 MiB 2.13 MiB 557.54 KiB
96eeafa 1.58 MiB 2.19 MiB 620.21 KiB
44472da 0 B 0 B 0 B
694d587 1.58 MiB 2.19 MiB 620.06 KiB
694d587 1.58 MiB 2.19 MiB 620.06 KiB
bb0ff41 0 B 0 B 0 B
0d66c0b 1.58 MiB 2.29 MiB 720.89 KiB
e2dce0b 0 B 0 B 0 B
ce0a49e 1.58 MiB 2.10 MiB 532.94 KiB
ad8da22 1.58 MiB 2.29 MiB 719.83 KiB

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

Startup times

Revision Plain With Sentry Diff
5fb84e7 313.33 ms 358.94 ms 45.61 ms
4da1e0e 315.68 ms 363.16 ms 47.48 ms
43bfb15 311.96 ms 359.57 ms 47.61 ms
3037860 357.82 ms 424.16 ms 66.35 ms
2385db7 377.33 ms 453.35 ms 76.02 ms
0b8acc4 292.31 ms 369.24 ms 76.93 ms

App size

Revision Plain With Sentry Diff
5fb84e7 0 B 0 B 0 B
4da1e0e 0 B 0 B 0 B
43bfb15 0 B 0 B 0 B
3037860 0 B 0 B 0 B
2385db7 0 B 0 B 0 B
0b8acc4 0 B 0 B 0 B

Point the performance entry at the replacement pull request.

Co-Authored-By: Codex <noreply@openai.com>
@romtsn romtsn added the sanity-check PR needs a lightweight review for obvious issues label Aug 18, 2026
@romtsn
romtsn marked this pull request as ready for review August 18, 2026 09:09
@sentry

sentry Bot commented Aug 18, 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

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.

1 participant