Skip to content
Development
Skill

/python-performance

Profiles Python code for performance bottlenecks and memory issues. Use when Python code is slow or when profiling for optimization before a release.

From plugin
claude-night-market
337200 skills59 agents162 commands1 MCP
Install
$ npx -y skills add athola/claude-night-market --skill python-performance --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/python-performance

Context preview

The summary Claude sees to decide when to auto-load this skill.

Profiles Python code for performance bottlenecks and memory issues. Use when Python code is slow or when profiling for optimization before a release.

SKILL.md

python-performance.SKILL.md
name: python-performance
description: Profiles Python code for performance bottlenecks and memory issues. Use when Python code is slow or when profiling for optimization before a release.
globs: "**/*.py"
alwaysApply: false
category: performance
tags:
- python
- performance
- profiling
- optimization
- cProfile
- memory
tools: []
usage_patterns:
- performance-analysis
- bottleneck-identification
- memory-optimization
- algorithm-optimization
complexity: intermediate
model_hint: standard
estimated_tokens: 1200
progressive_loading: true
modules:
- modules/profiling-tools.md
- modules/optimization-patterns.md
- modules/memory-management.md
- modules/benchmarking-tools.md
- modules/best-practices.md

Python Performance Optimization

Profiling and optimization patterns for Python code.

Table of Contents

1. [Quick Start](#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](modules/profiling-tools.md)

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](modules/optimization-patterns.md)

Eleven proven optimization patterns including list comprehensions, generators, caching, string concatenation, data structures, NumPy, multiprocessing, database operations, and loop transformations (what works in Python vs the compiler).

[memory-management](modules/memory-management.md)

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

[benchmarking-tools](modules/benchmarking-tools.md)

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

[best-practices](modules/best-practices.md)

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
Read more
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

Get the whole plugin

Other skills on claude-night-market.