Skip to content

[Due for payment 2026-09-17] Add automated release-build startup benchmarking #98280

Closed

Description

@mountiny

Background

Sentry spans give useful timing data, but release builds strip normal console logging, release behavior differs from development builds, and Android and iOS need different tooling to launch apps and collect logs.

Problem

Startup performance work is currently evaluated with ad hoc measurements that vary by developer, platform, device, and build. Results are therefore hard to reproduce or compare, which makes it difficult to tell whether a change improves typical and tail startup times or introduces a regression.

Solution

Add opt-in structured logging for selected Sentry spans plus a reusable Android/iOS benchmark script that:

  • Runs repeated process or true-cold startups.
  • Collects span durations automatically.
  • Records raw samples.
  • Reports Average, P50, P75, P90, P95, and P99.
  • Shares device tooling with future PGO and flow benchmarks.
  • Allows configuring the number of runs, device, app bundle, and similar options.

How the draft implements this

  • Developers list the exact span names to measure in the git-ignored root .env via EXPO_PUBLIC_BENCHMARK_SENTRY_SPANS.
  • Successful, non-canceled allowlisted spans emit a flat machine-readable [EXPENSIFY_BENCHMARK] JSON event. It uses console.warn because lower console levels are stripped from release bundles, and since the app's Sentry console integration forwards only errors, these lines create no Sentry events and no network traffic.
  • scripts/benchmarkAppStartup.ts runs under Bun against an Android device or a physical iOS device, supporting --span, --device, process and true-cold modes, configurable run counts, timeouts and app identifiers, CSV output, and P50/P75/P90/P95/P99 statistics. It prints its full resolved configuration before running.
  • Shared Android adb and iOS xcrun devicectl behavior lives in scripts/lib/nativeAppBenchmark.ts, so the benchmark workflow can be reused by PGO tooling without duplicating device operations or statistics.
  • contributingGuides/BENCHMARKING.md documents release configuration, local benchmark commands, true-cold behavior, and PGO integration.

The timestamp clock-domain correctness change is deliberately out of scope and will follow in a separate PR.

Draft PR

#98144

Slack discussion

https://expensify.slack.com/archives/C05LX9D6E07/p1786379259283529

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. 20 remaining items

  2. melvin-bot commented on Sep 14, 2026

    @melvin-bot

    @chrispader Whoops! This issue is 2 days overdue. Let's get this updated quick!

  3. melvin-bot commented on Sep 16, 2026

    @melvin-bot

    @chrispader Huh... This is 4 days overdue. Who can take care of this?

  4. roryabraham commented on Sep 18, 2026

    @roryabraham
    Contributor

    This is done

  5. changed the title [-]Add automated release-build startup benchmarking[/-] [+][Due for payment 2026-10-08] Add automated release-build startup benchmarking[/+] on Oct 8, 2026
  6. melvin-bot commented on Oct 8, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  7. changed the title [-][Due for payment 2026-10-08] Add automated release-build startup benchmarking[/-] [+][Due for payment 2026-09-17] Add automated release-build startup benchmarking[/+] on Oct 8, 2026
  8. mallenexpensify commented on Oct 8, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @daledah due $250 via NewDot

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2Task

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions