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
343200 skills60 agents162 commands1 MCP

Claude Code

$ npx -y skills add athola/claude-night-market --skill python-performance --agent claude-code

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
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.

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
@athola
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.

343200 skills60 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
343
Star history of athola/claude-night-market on GitHub, a chart by star-history.com

Other skills on claude-night-market.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about python-performance.

Which coding agents can use python-performance?
python-performance installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.