performance

star 0

Identify and improve performance and scalability through profiling, benchmarking, and optimization patterns. Covers latency reduction, memory efficiency, and throughput improvements. Use before releases or when metrics indicate issues.

jahales By jahales schedule Updated 2/4/2026

name: performance description: 'Identify and improve performance and scalability through profiling, benchmarking, and optimization patterns. Covers latency reduction, memory efficiency, and throughput improvements. Use before releases or when metrics indicate issues.'

Performance Skill

Use this skill to evaluate and enhance the performance and scalability of the codebase. Follow these guidelines:

Measurement

  • Profile first – Use profiling tools to measure CPU, memory and I/O usage. Benchmark with realistic workloads to identify hot spots.
  • Establish baselines – Record current performance metrics (latency, throughput, resource usage) before optimising. Compare against targets.

Complexity & Algorithms

  • Assess the algorithmic complexity of functions. Replace inefficient algorithms (e.g. O(n²) loops) with more scalable alternatives.
  • Choose appropriate data structures for the task (e.g. hash maps for lookups, queues for FIFO processing).

Concurrency & Asynchrony

  • Utilise concurrency primitives (threads, async/await, goroutines) where they improve throughput. Avoid blocking calls on the main thread.
  • Ensure shared state is protected with locks or other synchronisation mechanisms. Prevent race conditions and deadlocks.

Resource Management

  • Manage memory, file handles and network connections carefully. Allocate and release resources promptly (e.g. use context managers in Python or using statements in C#).
  • Avoid unnecessary memory copies and large intermediate allocations.

Caching & Memoization

  • Cache expensive computations or remote calls where appropriate. Use proper invalidation strategies (TTL, LRU) to avoid stale data.
  • Prefer immutable data where possible to simplify caching and concurrency.

I/O Efficiency

  • Batch operations to reduce overhead (e.g. bulk database writes, batch API requests). Use streaming for large files or payloads.
  • Minimise network round trips. Use connection pooling for database and HTTP clients.

Scalability

  • Design services to scale horizontally: keep them stateless where possible and externalise state to databases or caches.
  • Implement back‑pressure mechanisms (queues, circuit breakers, rate limiting) to handle overload gracefully.

Observability

  • Collect metrics, traces and logs to monitor performance in production. Dashboards and alerts help detect regressions early.
  • Add instrumentation at key points (e.g. request start/end, database queries) to measure latency and throughput.

When suggesting optimisations, balance performance gains against code readability and maintainability. Document any trade‑offs or additional complexity introduced by optimisations.

Install via CLI
npx skills add https://github.com/jahales/etude-story --skill performance
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator