# Python Performance

Python Performance guides AI assistants in profiling bottlenecks, reducing memory footprints, and speeding up Python workloads.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 192 installs · ★ 7 repo stars
- Author: pluginagentmarketplace
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pluginagentmarketplace/custom-plugin-python/tree/HEAD/skills/python-performance/SKILL.md
- Updated: 2026-01-05
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/python-performance

## What it does

The skill feeds concrete optimization patterns directly to your coding assistant. It covers four major pillars: execution profiling via `cProfile`, `timeit`, and `memory_profiler`, smart collection selection like `deque` and `bisect`, memory footprint reduction using `__slots__`, and accelerated computing with NumPy and Numba.

Instead of generic advice, your agent applies verified patterns. It converts memory-heavy list iterations into lightweight generators and replaces slow linear lookups with O(1) set operations.

Line-by-line metrics and RAM tracking depend directly on extra third-party tools like `line_profiler` and `memory_profiler`. You must install these dependencies into your virtual environment before running the profiling benchmarks.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill python-performance -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/python-performance/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/python-performance/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill python-performance -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/python-performance/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill python-performance -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/python-performance/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pluginagentmarketplace/custom-plugin-python skills/python-performance
```

2. **Manually: put the files in place**
- File: `.github/skills/python-performance/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill python-performance -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-python --path skills/python-performance
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/python-performance/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill python-performance -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pluginagentmarketplace/custom-plugin-python/tree/HEAD/skills/python-performance/SKILL.md

## When to use it
- identify execution bottlenecks using cProfile and timeit
- shrink instance memory usage with __slots__
- accelerate mathematical loops via NumPy vectorization and Numba
- avoid cache memory leaks with WeakValueDictionary

## Example prompts
- Profile this data processing pipeline with cProfile and list top bottlenecks
- Convert this class hierarchy to use __slots__ to save memory
- Vectorize these nested loops using NumPy array operations

## Similar
- [python-performance-optimization](https://affpapa.org/en/nevibecode/skills/python-performance-optimization.md) — skill · 35675 installs
- [python-repl](https://affpapa.org/en/nevibecode/skills/python-repl.md) — skill · 1 install
- [Python Code Performance & Quality Enhancer](https://affpapa.org/en/nevibecode/prompts/python-code-performance-quality-enhancer.md) — prompt · ★ 178201 repo stars
- [opencv-python](https://affpapa.org/en/nevibecode/rules/opencv-python.md) — rule · ★ 3589 repo stars
- [performance-engineer](https://affpapa.org/en/nevibecode/skills/zhaono1-performance-engineer.md) — skill · 718 installs
- [zarr-python](https://affpapa.org/en/nevibecode/skills/zarr-python.md) — skill · 2100 installs

From the same set: [pluginagentmarketplace/custom-plugin-python](https://affpapa.org/en/nevibecode/by/pluginagentmarketplace/custom-plugin-python.md) — 12 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
