Performance

Optimization patterns

hongmaple0820 9c40ca7 768 B Updated

File contents

Performance Optimization

Find and fix bottlenecks.

Measurement First

  • Profile before optimizing
  • Establish baseline metrics
  • Identify top bottlenecks

Common Issues

N+1 Queries

  • Use JOINs or batch queries
  • Check ORM lazy loading

Memory Leaks

  • Check unclosed resources
  • Review event listener cleanup

Blocking Operations

  • Async for I/O
  • Worker threads for CPU

Large Payloads

  • Pagination
  • Compression
  • Lazy loading

Checklist

  • Database queries indexed
  • No unbounded loops
  • Caching for hot paths
  • Assets optimized
  • Bundle size checked

Anti-Patterns

  • Premature optimization
  • Optimize without measuring
  • Trade correctness for speed

hongmaple0820/scale-engine/tree/main/.scale/skills/performance commit 9c40ca769e

Frequently asked questions

npx skillmds@latest add hongmaple0820/performance