# Optimization

Optimization is a critical part of developing a PlayCanvas application. It can mean the difference between a great user experience and a terrible one.

:::tip

Don't wait until a project is near completion before you consider optimization. Be thinking about it from the start. It may meaningfully impact how you design your application.

:::

Let's begin by establishing the key goals for optimization and highlight why each goal is important:

| Goal | Why it matters |
| ---- | -------------- |
| ⏱️ Minimize load time | Your users have limited patience. If your app does not load quickly, they may give up waiting and go elsewhere. |
| 🎞️ Maximize frame rate | A high (and stable) frame rate makes for pleasing visuals and low latency response to user input. |
| 🔋 Minimize CPU and GPU load | Just because your app maintains 60 frames per second does not mean your work is done. Reducing processor load preserves battery power and keeps devices running cool. |
| 🧠 Minimize memory utilization | Browsers allocate a limited pool of memory to applications. Once this pool is exhausted, the tab will crash and reload. Your users will be upset! |

## Measure Before Optimizing

Choose a repeatable scene or interaction, record a baseline on the target device, then measure each change under the same conditions.

| Tool | Use it for |
| ---- | ---------- |
| [MiniStats](https://developer.playcanvas.com/user-manual/optimization/mini-stats.md) | Watching frame time, CPU/GPU costs and GPU resource memory while interacting with the application. |
| [Profiling with AppStats](https://developer.playcanvas.com/user-manual/optimization/app-stats.md) | Reading public statistics from code and collecting reports for dashboards, agents and automated comparisons. |
| [Editor Profiler](https://developer.playcanvas.com/user-manual/optimization/profiler.md) | Inspecting the Editor Launch profiler, including asset loading and shader compilation timelines. |
| [GPU Profiling](https://developer.playcanvas.com/user-manual/optimization/gpu-profiling.md) | Capturing frames with native GPU tools for detailed rendering investigations. |
| [Inspector](https://developer.playcanvas.com/user-manual/scripting/debugging/inspector.md) | Finding where video memory goes, which passes and draws a frame makes, and what each mesh and material uses, in the running application. |

:::ai
Give an AI assistant a performance goal, repeatable scenario and baseline reports from **[AppStats](https://developer.playcanvas.com/user-manual/optimization/app-stats.md#collecting-periodic-reports)**. It can combine these with MiniStats or browser evidence and propose one measurable change at a time. Use the **[Editor MCP Server](https://developer.playcanvas.com/user-manual/editor/mcp-server.md)** to replay Editor input or follow **[Developing with AI](https://developer.playcanvas.com/user-manual/engine/developing-with-ai.md)** for standalone projects.
:::
