---
title: Startup Performance Analysis
docType: default
---

# Startup Performance Analysis

Startup performance analysis observes the time from when the miniapp is opened to when the first screen finishes rendering. It is used to diagnose issues like "slow to open" or "long blank screen on first load".

## How to Enable

Before starting analysis, access the debugging tool entry.

1. Open the Ray miniapp page on a real device.
2. Access the debugging tool:
   - **iOS**: Tap the `...` button in the top-right corner, then tap **Debugging Tools** in the bottom sheet.
   - **Android**: Long-press the **X** button in the top-right corner, the App basic info panel will appear, then tap **Open Debug** at the bottom.

<Image src="/images/guide/optimization/open-experience-score-en.png" width="200px" />

3. Tap **Open Performance Tools** in the debugging tool menu.
4. Re-enter or re-trigger the miniapp startup flow and observe startup-related metrics.

<Image src="/images/guide/optimization/performance-tools-en.png" width="200px" />

## Applicable Scenarios

- The page is noticeably slow on first open
- Startup time has increased after a version update
- First screen content appears too late
- Need to compare startup time before and after optimization

## Key Metrics

**Miniapp Metrics**

<div className="startup-metrics-table">

| Metric | Description | Investigation Threshold | Notes |
| ------ | ----------- | ----------------------- | ----- |
| Startup time | Time from tapping the miniapp to page render complete | > 1500ms | First open usually includes download time |
| Download time | Time to download the miniapp package | > 1000ms | Only triggered when there is no cache |
| Preparation time | Time from tapping the miniapp to JS code starting injection | > 500ms | Reflects runtime initialization speed |
| Page render time | Duration of miniapp page rendering | > 500ms | Reflects page complexity and first-screen rendering pressure |
| Frame rate | Real-time frame rate of the current page | < 30 FPS | Higher values mean smoother pages |
| Average frame rate | Average frame rate of the current page | < 50 FPS | Reflects overall smoothness level |

</div>

> The investigation thresholds above are industry-standard reference values. Actual standards are subject to business acceptance requirements.

**App Metrics**

| Metric | Description |
| ------ | ----------- |
| CPU | CPU usage of the current App |
| Memory | Memory occupied by the current App |
| Startup time | Time from tapping App launch to ready state |

## How to Interpret Results

- **High startup time**: Check the main package size and whether first-screen dependencies are too heavy.
- **High download time**: Check package size and whether images or static assets are too large.
- **High preparation time**: Usually indicates slow runtime initialization; check for excessive synchronous logic blocking the injection flow.
- **High page render time**: Usually indicates overly complex first-screen content or async operations blocking rendering.

If you have identified the issue, refer to the following documents:

- [Package Size Optimization](/en/miniapp/develop/ray/guide/optimization/startup/package-size)
- [Code Injection Optimization](/en/miniapp/develop/ray/guide/optimization/startup/code-injection)
- [First Screen Render Optimization](/en/miniapp/develop/ray/guide/optimization/startup/first-render)
