test(android): Add Jetpack Macrobenchmark for SDK init performance (JAVA-604)#5680
Merged
Merged
Conversation
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| abfcc92 | 304.04 ms | 370.33 ms | 66.29 ms |
| 4e3e79d | 365.83 ms | 477.62 ms | 111.79 ms |
| d8912da | 329.94 ms | 389.68 ms | 59.74 ms |
| d15471f | 294.13 ms | 399.49 ms | 105.36 ms |
| abf451a | 332.82 ms | 403.67 ms | 70.85 ms |
| 604a261 | 380.65 ms | 451.27 ms | 70.62 ms |
| 806307f | 357.85 ms | 424.64 ms | 66.79 ms |
| 22f4345 | 307.87 ms | 354.51 ms | 46.64 ms |
| d217708 | 375.27 ms | 415.68 ms | 40.41 ms |
| c3ee041 | 310.64 ms | 361.90 ms | 51.26 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| abfcc92 | 1.58 MiB | 2.13 MiB | 557.31 KiB |
| 4e3e79d | 0 B | 0 B | 0 B |
| d8912da | 0 B | 0 B | 0 B |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
| abf451a | 1.58 MiB | 2.20 MiB | 635.29 KiB |
| 604a261 | 1.58 MiB | 2.10 MiB | 533.42 KiB |
| 806307f | 1.58 MiB | 2.10 MiB | 533.42 KiB |
| 22f4345 | 1.58 MiB | 2.29 MiB | 719.83 KiB |
| d217708 | 1.58 MiB | 2.10 MiB | 532.97 KiB |
| c3ee041 | 0 B | 0 B | 0 B |
e6f2ae9 to
9f8ff3d
Compare
romtsn
approved these changes
Jul 2, 2026
markushi
reviewed
Jul 2, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9f8ff3d. Configure here.
…AVA-604) Add sentry-uitest-android-macrobenchmark, a cold-start Macrobenchmark targeting sentry-samples-android. It reports timeToInitialDisplay from framework trace events, requiring no trace markers in the SDK or app. Per-iteration perfetto traces are saved for deeper analysis. CompilationMode.Full pins ART AOT; iterations are capped at 12 because back-to-back cold starts thermally throttle after ~14 iterations. To A/B an SDK change, interleave per-variant rounds so thermal drift does not systematically penalize the second variant (see README). Verified on a Galaxy A55 (Android 16): TTID median 514.5ms over 12 iterations. Requires androidx.benchmark 1.4.1; 1.3.4 fails to confirm activity launches on API 36. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
9f8ff3d to
22177e4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

📜 Description
Adds
sentry-uitest-android-macrobenchmark, a Jetpack Macrobenchmark module that measures cold start ofsentry-samples-androidon a connected device. It reportstimeToInitialDisplay(StartupTimingMetric) per iteration, taken from framework trace events — no trace markers needed in the SDK or the app. Each iteration's perfetto trace is saved for deeper analysis.Details:
CompilationMode.Full()pins ART AOT compilation so dexopt state can't drift between runs;StartupMode.COLDforce-stops (nopm clear) so app data persists.<profileable android:shell="true"/>manifest flag (required to profile its non-debuggable release build) — its only change.benchmarkbuild type pairs the debuggable test APK with the app's release build viamatchingFallbacks.androidx.benchmark1.4.1: 1.3.4 fails with "Unable to confirm activity launch completion" on Android 16 (API 36).💡 Motivation and Context
We currently rely on ad-hoc btrace/perfetto captures to measure Android SDK init cost. A Macrobenchmark gives a stable, reproducible, on-device measurement to validate init-time changes, and could be wired into CI later.
Closes #5679 (JAVA-604)
💚 How did you test it?
Ran
connectedBenchmarkAndroidTeston a Galaxy A55 (Android 16): TTID median 514.5 ms (min 496.2, max 585.4, stdev 24.3, n=12), with no thermal degradation across iterations.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog
🤖 Generated with Claude Code