performance-principles

amattas's avatarfrom amattas

Performance guidelines and patterns for this system.

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 26, 2025

When & Why to Use This Skill

This Claude skill provides a comprehensive framework of performance guidelines and architectural patterns designed to optimize system efficiency, minimize latency, and ensure long-term scalability. It serves as a technical North Star for developers to balance code clarity with high-performance execution across both backend and frontend layers.

Use Cases

  • Code Review Checklist: Use these principles as a standardized rubric during peer reviews to catch common pitfalls like N+1 queries, expensive computations, and synchronous bottlenecks.
  • System Design & Planning: Apply the backend and frontend guidelines during the initial architecture phase to implement efficient query patterns, caching strategies, and lazy-loading from day one.
  • Performance Auditing & Optimization: Evaluate existing legacy systems against the 'Common Pitfalls' to identify high-impact optimization targets and improve algorithmic efficiency.
  • SLA & Monitoring Setup: Utilize the monitoring section to define performance budgets (e.g., 95th percentile latency) and implement essential instrumentation for critical system paths.
nameperformance-principles
descriptionPerformance guidelines and patterns for this system.

Performance Principles

General Principles

  • Optimize for correct, clear code first; then optimize hot paths.
  • Measure before optimizing when possible.
  • Prefer algorithmic improvements over micro-optimizations.

Common Pitfalls

  • N+1 queries in database access.
  • Unbounded in-memory collections for large datasets.
  • Synchronous calls in latency-sensitive paths.
  • Repeated expensive computations without caching.

Guidelines by Layer

Backend

  • Use efficient query patterns and indices.
  • Batch calls where practical.
  • Apply backpressure and rate limiting where needed.

Frontend

  • Avoid unnecessary re-renders.
  • Lazy-load heavy components and routes.
  • Cache data appropriately (client & server).

Monitoring & Metrics

  • Ensure critical paths have basic instrumentation:
    • Latency, error rate, throughput.
  • Define performance budgets (e.g., 95th percentile latency thresholds).

When to Escalate

  • If a change risks breaching performance budgets.
  • If complexity grows significantly (e.g., big-O behavior worsens).