Sign in
Explore
Skills · SkillEveryday codingDevOps & CloudReviewed

python-performance-optimization

Profiles and speeds up slow Python code with cProfile and memory profilers.

Kind
Skill
Works with
Claude Code, Codex
Languages
Python
Source
wshobson/agents @ 0874a27b17a2
Path
plugins/python-development/skills/python-performance-optimization/SKILL.md
License
MIT
Jobs
Debugging
InstallInstall it from a plugin marketplace.
/plugin install python-development@claude-code-workflows
# 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

- **CPU Profiling**: Identify time-consuming functions
- **Memory Profiling**: Track memory allocation and leaks
- **Line Profiling**: Profile at line-by-line granularity
- **Call Graph**: Visualize function call relationships

### 2. Performance Metrics

- **Execution Time**: How long operations take
- **Memory Usage**: Peak and average memory consumption
- **CPU Utilization**: Processor usage patterns
- **I/O Wait**: Time spent on I/O operations

### 3. Optimization Strategies
…