python-performance

Python performance profiling and optimization: bottleneck detection, memory tuning, benchmarking

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "python-performance" with this command: npx skills add athola/nm-parseltongue-python-performance

Night Market Skill — ported from claude-night-market/parseltongue. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

Python Performance Optimization

Profiling and optimization patterns for Python code.

Table of Contents

  1. Quick Start

Quick Start

# Basic timing
import timeit
time = timeit.timeit("sum(range(1000000))", number=100)
print(f"Average: {time/100:.6f}s")

Verification: Run the command with --help flag to verify availability.

When To Use

  • Identifying performance bottlenecks
  • Reducing application latency
  • Optimizing CPU-intensive operations
  • Reducing memory consumption
  • Profiling production applications
  • Improving database query performance

When NOT To Use

  • Async concurrency - use python-async instead
  • CPU/GPU system monitoring - use conservation:cpu-gpu-performance
  • Async concurrency - use python-async instead
  • CPU/GPU system monitoring - use conservation:cpu-gpu-performance

Modules

This skill is organized into focused modules for progressive loading:

profiling-tools

CPU profiling with cProfile, line profiling, memory profiling, and production profiling with py-spy. Essential for identifying where your code spends time and memory.

optimization-patterns

Ten proven optimization patterns including list comprehensions, generators, caching, string concatenation, data structures, NumPy, multiprocessing, and database operations.

memory-management

Memory optimization techniques including leak tracking with tracemalloc and weak references for caches. Depends on profiling-tools.

benchmarking-tools

Benchmarking tools including custom decorators and pytest-benchmark for verifying performance improvements.

best-practices

Best practices, common pitfalls, and exit criteria for performance optimization work. Synthesizes guidance from profiling-tools and optimization-patterns.

Exit Criteria

  • Profiled code to identify bottlenecks
  • Applied appropriate optimization patterns
  • Verified improvements with benchmarks
  • Memory usage acceptable
  • No performance regressions

Troubleshooting

Common Issues

Command not found Ensure all dependencies are installed and in PATH

Permission errors Check file permissions and run with appropriate privileges

Unexpected behavior Enable verbose logging with --verbose flag

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Cloudflare Manager

Manage Cloudflare DNS records, Tunnels (cloudflared), and Zero Trust policies. Use for pointing domains, exposing local services via tunnels, and updating in...

Registry SourceRecently Updated
Coding

Node Red Manager

Manage Node-RED instances via Admin API or CLI. Automate flow deployment, install nodes, and troubleshoot issues. Use when user wants to "build automation", "connect devices", or "fix node-red".

Registry SourceRecently Updated
Coding

Yt Dlp

A robust CLI wrapper for yt-dlp to download videos, playlists, and audio from YouTube and thousands of other sites. Supports format selection, quality control, metadata embedding, and cookie authentication.

Registry SourceRecently Updated
Coding

Daily Dev Agentic

daily.dev Agentic Learning - continuous self-improvement through daily.dev feeds. Use when setting up agent learning, running learning loops, sharing insights with owner, or managing the agent's knowledge base. Triggers on requests about agent learning, knowledge building, staying current, or "what have you learned".

Registry SourceRecently Updated