Repository navigation
Description
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
.envviaEXPO_PUBLIC_BENCHMARK_SENTRY_SPANS. - Successful, non-canceled allowlisted spans emit a flat machine-readable
[EXPENSIFY_BENCHMARK]JSON event. It usesconsole.warnbecause 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.tsruns 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
adband iOSxcrun devicectlbehavior lives inscripts/lib/nativeAppBenchmark.ts, so the benchmark workflow can be reused by PGO tooling without duplicating device operations or statistics. contributingGuides/BENCHMARKING.mddocuments 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
Slack discussion
https://expensify.slack.com/archives/C05LX9D6E07/p1786379259283529
Issue Owner
Current Issue Owner: @mallenexpensifyMetadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
20 remaining items
melvin-bot commentedon Sep 14, 2026
@chrispader Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Sep 16, 2026
@chrispader Huh... This is 4 days overdue. Who can take care of this?
roryabraham commentedon Sep 18, 2026
This is done
[-]Add automated release-build startup benchmarking[/-][+][Due for payment 2026-10-08] Add automated release-build startup benchmarking[/+]melvin-bot commentedon Oct 8, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)[-][Due for payment 2026-10-08] Add automated release-build startup benchmarking[/-][+][Due for payment 2026-09-17] Add automated release-build startup benchmarking[/+]mallenexpensify commentedon Oct 8, 2026
Payment Summary
Contributor+: @daledah due $250 via NewDot