From python-development
Profile and optimize Python code using cProfile, memory profilers, and performance best practices. Use when debugging slow code or optimizing bottlenecks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/python-development:python-performance-optimizationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Comprehensive guide to profiling, analyzing, and optimizing Python code for better performance, including CPU profiling, memory optimization, and implementation best practices.
Comprehensive guide to profiling, analyzing, and optimizing Python code for better performance, including CPU profiling, memory optimization, and implementation best practices.
import time
def measure_time():
"""Simple timing measurement."""
start = time.time()
# Your code here
result = sum(range(1000000))
elapsed = time.time() - start
print(f"Execution time: {elapsed:.4f} seconds")
return result
# Better: use timeit for accurate measurements
import timeit
execution_time = timeit.timeit(
"sum(range(1000000))",
number=100
)
print(f"Average time: {execution_time/100:.6f} seconds")
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
2plugins reuse this skill
First indexed Jun 3, 2026
npx claudepluginhub wshobson/agents --plugin python-developmentProfile and optimize Python code using cProfile, memory profilers, and performance best practices. Use when debugging slow code or optimizing bottlenecks.
Profiles and optimizes Python code using cProfile, timeit, memory profilers, and best practices for bottlenecks, slow execution, high memory, and latency.
Profiles Python code for performance bottlenecks and memory issues using cProfile, line profiling, and memory profiling. Use when Python code is slow or before a release.