Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
athola avatar

Python Performance

  • 104 installs
  • 325 repo stars
  • Updated August 2, 2026
  • athola/claude-night-market

Profile Python hot paths and benchmark fixes with decorators and pytest-benchmark before shipping slower code.

About

Python Performance is a compact agent skill covering benchmarking tools and optimization best practices for solo builders shipping Python services or scripts. It teaches a reusable benchmark decorator that prints elapsed seconds per call, and pytest-benchmark patterns for comparing implementations like list comprehensions under test. The best-practices section stresses profiling first and targeting real bottlenecks rather than micro-optimizing cold code. Use it when your agent is rewriting loops, adding caching, or arguing about algorithm choice and you need evidence. It pairs naturally with profiling skills elsewhere in a night-market style catalog. Intermediate familiarity with pytest helps; beginners can still copy the decorator for one-off timing.

  • Custom @benchmark decorator using time.perf_counter for quick function timing
  • pytest-benchmark fixtures with pytest --benchmark-compare for regression checks
  • Best-practice rules: profile before optimizing and focus on hot paths
  • Documented pip install pytest-benchmark entry point for test runs

Python Performance by the numbers

  • 104 all-time installs (skills.sh)
  • Ranked #103 of 290 Python skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/athola/claude-night-market --skill python-performance

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs104
repo stars325
Security audit3 / 3 scanners passed
Last updatedAugust 2, 2026
Repositoryathola/claude-night-market

What it does

Profile Python hot paths and benchmark fixes with decorators and pytest-benchmark before shipping slower code.

Files

SKILL.mdMarkdownGitHub ↗

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

Related skills

FAQ

Is Python Performance safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Pythonbackendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.