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

# Startup Performance

Miniapp startup is a critical part of the user experience. Long startup times lead to user churn and negatively impact retention.

## What Is Miniapp Startup

Miniapp startup has two types:

| Type | Definition | Characteristics |
| ---- | ---------- | --------------- |
| **Cold start** | First open, or re-open after the system has destroyed the miniapp | Requires the full startup flow; takes longer |
| **Warm start** | Miniapp is already running in the background and user returns | No reload needed; nearly instant |

The startup performance optimization discussed in this section focuses on the **cold start** scenario.

## Definition of Startup Time

The miniapp startup process begins when the **user opens the miniapp** and ends when the **home page finishes rendering**.

- **Start point**: User taps the miniapp entry
- **End point**: The first page's `Page.onReady` event fires

## Startup Time Guidelines

| Scenario | Recommended Time |
| -------- | ---------------- |
| First open (with download) | < 3000ms |
| Subsequent opens (using local cache) | < 1500ms |

## Startup Optimization Directions

The following phases in the miniapp startup flow are developer-controllable:

| Direction | Goal | Details |
| --------- | ---- | ------- |
| Package size optimization | Reduce download size and speed up download | [Package Size Optimization](/en/miniapp/develop/ray/guide/optimization/startup/package-size) |
| Code injection optimization | Reduce code execution time | [Code Injection Optimization](/en/miniapp/develop/ray/guide/optimization/startup/code-injection) |
| First screen render optimization | Speed up page content display | [First Screen Render Optimization](/en/miniapp/develop/ray/guide/optimization/startup/first-render) |

For complete startup flow details, see [Launch Process](/en/miniapp/develop/ray/guide/optimization/startup/launch-process).
