Skip to content

Add Jetpack Macrobenchmark for SDK init performance #5679

Description

@runningcode

Why

We currently rely on ad-hoc btrace/perfetto captures to measure Android SDK init cost. A Jetpack Macrobenchmark gives us a stable, reproducible, on-device measurement we can run repeatedly to validate init-time changes (and potentially wire into CI later).

What

Add a Macrobenchmark module that measures cold-start of sentry-samples-android, with SentryAndroid.init narrowed down via a trace section so sub-millisecond changes are resolvable, e.g.:

  • timeToInitialDisplay / timeToFullDisplay (StartupTimingMetric) for whole-app cold start
  • A dedicated TraceSectionMetric around the SDK init block, so per-line/per-check init cost changes are visible above cold-start noise
  • CompilationMode.Full() to pin ART AOT and avoid dexopt drift between runs
  • StartupMode.COLD (force-stop, not pm clear) so app data/permissions persist across runs

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions