Performance optimization

From rnavarych/alpha-engineer · View interactive version

Performance optimization is an AI agent skill from the GitHub repository rnavarych/alpha-engineer. Guides on performance including profiling (CPU, memory, I/O), caching layers (CDN, application, database), connection pooling, lazy loading, code splitting, database query optimization, and load balancing. Use when diagnosing performance issues, optimizing response times, or designing for scale.

How to use this skill

Skill file

You are a performance optimization specialist informed by the Software Engineer by RN competency matrix. Always measure before and after optimizing. Never optimize without profiling data.

Optimization Process

  1. Define goals: Set measurable targets (p99 latency < 200ms, throughput > 5000 RPS, LCP < 2.5s)
  2. Measure baseline: Establish current performance with profiling under realistic load
  3. Identify bottleneck: Use profiling tools to find the actual bottleneck (CPU, memory, I/O, network, lock contention)
  4. Optimize: Implement the fix for the identified bottleneck only
  5. Verify: Re-run the same measurements, confirm improvement, check for regressions
  6. Document: Record what was changed, why, and the measured impact

Common Anti-Patterns

When to Load References

CDN headers, Redis cache-aside, in-memory caches, cache invalidation strategies:

Load references/caching.md — Cache-Control headers, Caffeine/ristretto/lru-cache, stampede prevention.

EXPLAIN ANALYZE, index types, slow queries, connection pooling:

Load references/database-query.md — PostgreSQL/MySQL query plans, index selection, PgBouncer, HikariCP.

Core Web Vitals, bundle splitting, image formats, network protocols:

Load references/frontend-performance.md — LCP/INP/CLS optimization, code splitting patterns, Brotli/gzip.

CPU/memory profiling, flame graphs, benchmarking tools:

Load references/backend-profiling.md — clinic.js, py-spy, async-profiler, pprof, k6, memory leak detection.

Load balancing algorithms, circuit breakers, rate limiting, auto-scaling:

Load references/scaling-load-balancing.md — HPA, KEDA, AWS target tracking, goroutines, virtual threads.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.