Sentry Andrew McKnight Sep 27, 2024

Mobile App Launch Profiling

Article Summary

Andrew McKnight from Sentry just solved one of mobile performance monitoring's biggest blind spots. Ever wondered what's actually happening in your app before main() even gets called?

Sentry's engineering team has shipped app launch profiling for iOS and Android, capturing performance data from the moment your app starts executing code. This goes beyond Apple's MetricKit and Instruments by profiling the critical pre-main() execution phase that traditional tools miss entirely.

Key Takeaways

Critical Insight

You can now profile real user app launches from the very first line of code execution, revealing performance issues that Apple's own tools don't measure.

The team considered profiling even the very first install launch, but held back for an interesting reason.

About This Article

Problem

Apple's MetricKit only measures launch time until the first frame appears. It misses what happens after that, like splash screens and loading spinners, which actually affect how responsive users think the app is.

Solution

Sentry built app launch profiling by starting the profiler in the SDK's +[load] methods. This captures execution data before main() runs and connects the profiles with Time to Full Display tracing in App Starts insights.

Impact

Developers can now see complete flamechart visualizations of pre-main() execution on real devices. This exposes performance bottlenecks that Apple's tools don't show.