python-performance-optimization

Installation
Summary

Profile and optimize Python code using cProfile, memory profilers, and performance best practices.

  • Covers CPU profiling with cProfile, line-by-line profiling with line_profiler, memory tracking with memory_profiler, and production profiling with py-spy
  • Includes 20+ optimization patterns: list comprehensions, generators, string concatenation, dictionary lookups, NumPy vectorization, caching, multiprocessing, and async I/O
  • Provides database optimization techniques including batch operations, query planning, and indexing strategies
  • Features memory leak detection with tracemalloc, weak references for caches, and benchmarking tools including custom decorators and pytest-benchmark integration
SKILL.md

Python Performance Optimization

Comprehensive guide to profiling, analyzing, and optimizing Python code for better performance, including CPU profiling, memory optimization, and implementation best practices.

When to Use This Skill

  • Identifying performance bottlenecks in Python applications
  • Reducing application latency and response times
  • Optimizing CPU-intensive operations
  • Reducing memory consumption and memory leaks
  • Improving database query performance
  • Optimizing I/O operations
  • Speeding up data processing pipelines
  • Implementing high-performance algorithms
  • Profiling production applications

Core Concepts

1. Profiling Types

Related skills

More from wshobson/agents

Installs
22.0K
Repository
wshobson/agents
GitHub Stars
35.2K
First Seen
Jan 20, 2026