performance · git:20260317.255bfa9 · 2026-03-17 · sha256 9a9906ff48e010f0

performance git:20260317.255bfa9A

Immutable. This exact content is served forever at /api/v1/blob/9a9906ff48e010f0.

---
name: performance
description: Make everything fast and resource-efficient. Cheaper servers, faster loading.
---

# Performance

Apply automatically during building:

1. **Fast startup** — App should start in under 2 seconds
2. **Fast response** — Page load under 1 second, API response under 200ms
3. **Low memory** — Stay under 100MB RAM for most apps
4. **Small binary/bundle** — Minimize what needs to be downloaded
5. **Lazy loading** — Don't load what isn't needed yet
6. **Caching** — Cache what doesn't change often
7. **Database queries** — Use indexes, avoid N+1 queries
8. **Images** — Compress, use WebP, lazy load

When done optimizing, if significant: "我优化了一下,页面打开速度从3秒降到0.8秒了。"