---
name: dev-performance-performance-basics
description: Core R3F/Three.js performance optimization principles. Use when FPS drops below 60.
category: performance
---
# Performance Optimization Basics
> "Optimize for mobile, scale up for desktop – 60 FPS is the goal."
## When to Use
Use when:
- FPS drops below 60
- Debugging performance issues
- Starting optimization work
## The 16ms Budget (60 FPS)
| System | Budget | Notes |
| ---------- | ----------- | --------------------- |
| Input | ~1ms | Event handling |
| Physics | ~3ms | Rapier/Cannon updates |
| Game Logic | ~4ms | State, AI, animations |
| Render | ~5ms | Three.js draw calls |
| Buffer | ~3ms | Safety margin |
| **Total** | **16.67ms** | 60 FPS target |
## Quick Start Canvas Config
```tsx
// Performance-optimized Canvas
```
## Decision Framework
| Symptom | Likely Cause | Solution |
| ------------------ | ------------------- | ------------------- |
| Low FPS everywhere | Too many draw calls | Instancing, merging |
| FPS drops on zoom | LOD not implemented | Add LOD system |
| Mobile slow | DPR too high | Limit to 1.5 |
| Memory grows | Dispose missing | Add cleanup |
| Stuttering | GC pressure | Object pooling |
## Progressive Optimizations
### Level 1: Basic
```tsx
// Limit device pixel ratio