1---2name: eng-performance3description: Guard latency, memory, battery, bandwidth, and gas/compute budgets by measuring before and after every change.4---56# Performance and Efficiency Awareness78## Intent9- Treat budgets (frame time, network round-trips, server CPU, on-chain gas) as first-class requirements.10- Prevent regressions by profiling early, not after user complaints.1112## Inputs131. Existing SLAs/budgets per platform (FPS, TTI, API latency, contract gas caps).142. Representative workloads, datasets, replays, or load scripts.153. Tooling: profilers, flamegraphs, shader analyzers, gas estimators, Lighthouse, etc.1617## Workflow181. **Establish baseline**19 - Capture metrics for the current implementation under realistic load/device tiers.202. **Design with budgets**21 - Choose data structures, rendering strategies, and contract patterns aligned with constraints.22 - Consider caching, pagination, batching, and compression aggressively.233. **Measure iteratively**24 - After each significant change, run targeted benchmarks or simulations.25 - Track results in the PR/issue; highlight deltas and why they are acceptable.264. **Optimize where it matters**27 - Focus on user-facing bottlenecks; avoid premature micro-optimizations.28 - For web3, minimize storage writes and external calls; for mobile, monitor battery/thermal impact.2930## Verification31- Benchmarks or profiling output attached, showing no regression (or justified improvements).32- Budgets documented; alarms/alerts configured if applicable.33- For regressions that cannot be fixed immediately, open a follow-up issue with owner, impact, and mitigation.