
Description
python-performance-optimization is an agent skill from the wshobson/agents collection for profiling and optimizing Python code. Its rule is to measure before changing anything, so effort goes to the real bottleneck rather than to guesses. The skill covers the profiling types and the tools for each: cProfile for CPU profiling of whole programs, line_profiler for line-by-line timing inside a function, memory_profiler for tracking memory use, and py-spy for profiling production applications without changing their code. It explains how to find and read the hot spots in a profile and how to reduce latency and response times, optimize CPU-intensive operations, cut memory consumption and find leaks, improve database query performance and I/O, speed up data processing pipelines, and choose high-performance algorithms. The skill applies when debugging slow Python code, identifying bottlenecks, reducing latency, optimizing CPU-heavy work, reducing memory use, and profiling a live application. Optimization changes can make code harder to read, so the skill's guidance favors changes that the measurements justify and that keep behavior the same. The agent uses the profiles to pick targets and checks that the change speeds up the measured path. The skill is installed with the skills CLI from the wshobson/agents repository. Its skills.sh page showed about 34.9K installs and passing results from three security audits at the time of the scan.…
Highlights
- cProfile for CPU profiling
- line_profiler for line-by-line timing
- memory_profiler for memory tracking
- py-spy for production profiling
- Measure before optimizing
- Installs with the skills CLI
Ratings & Reviews
No ratings yet
Be the first to rate python-performance-optimization.
People also visit

performance-optimization
Optimizes application performance across frontend, backend, queries

agent-performance-optimizer
Agent skill for performance-optimizer - invoke with $agent-performance-optimizer

argent-react-native-optimization
Optimizes a React Native app by profiling first to find real bottlenecks

benchmark-optimization-loop
Convert 'make it faster' requests into a bounded measured optimization loop
python-performance-optimization FAQ
Which profilers are covered?
cProfile for CPU, line_profiler for line-by-line timing, memory_profiler for memory, and py-spy for production applications.
Can I profile a running production app?
The skill covers production profiling with py-spy, which samples a process without changing its code.
Does it cover databases and I/O?
Yes. Improving database query performance and optimizing I/O are among the topics.
Why measure first?
The skill's approach is to find the real bottleneck with a profile before changing code, so effort goes where it matters.
How do I install it?
Run npx skills add https://github.com/wshobson/agents --skill python-performance-optimization.
What security audits does it have?
skills.sh lists three audits: Gen Agent Trust Hub Pass, Socket Pass and Snyk Pass.
What are the best python-performance-optimization alternatives?
Popular alternatives to python-performance-optimization include golang-performance, performance-optimization and agent-performance-optimizer. See all python-performance-optimization alternatives

