AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Python Performance

skill-caraya-agent-skills-python-performance · by caraya

Python performance skill for GIL analysis, profiling, and optimization including async patterns and algorithmic efficiency. Trigger phrases: Python performance, GIL contention, CPU profile, memory leak, import time, asyncio performance, slow algorithm.

No reviews yet
0 installs
42 views
0.0% view→install

Install

$ agentstack add skill-caraya-agent-skills-python-performance

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-caraya-agent-skills-python-performance)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Python Performance? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Python Performance

Use When

  • Profiling Python applications for CPU, memory, or I/O bottlenecks.
  • Analyzing GIL contention and threading/async alternatives.
  • Optimizing import time, algorithmic complexity, or memory usage.

Profiling Tools

  1. CPU profiling
  • cProfile: python -m cProfile -s cumulative script.py for deterministic profiling.
  • py-spy: Sampling profiler; attach to running process without instrumentation.
  • pyflame: Statistical profiler; good for production use.
  1. Memory profiling
  • memory_profiler: Line-by-line memory with @profile decorator.
  • objgraph: Detect memory leaks by visualizing object references.
  • tracemalloc: Built-in; track allocations over time.
  1. Async and I/O analysis
  • asyncio debug mode: Set asyncio.run(..., debug=True) or PYTHONASYNCDEBUG=1.
  • py-spy with --idle: See where time is spent (I/O wait vs. CPU).

Checklist

  1. GIL and threading
  • Is the bottleneck CPU-bound (GIL-limited) or I/O-bound?
  • For CPU-bound: use multiprocessing or Cython, not threading.
  • For I/O-bound: use async/await (asyncio) or thread pools, not threading.Thread.
  1. Import and startup performance
  • Measure import time: python -X importtime script.py | head -50.
  • Identify slow imports; move to lazy loading if not needed at startup.
  • Check for circular dependencies or expensive module initialization.
  1. Algorithmic and data structure efficiency
  • Profile CPU usage per function to find algorithm bottlenecks.
  • Check for O(n²) operations when O(n log n) alternatives exist.
  • Verify data structures are appropriate (dict vs. list, set vs. list for membership).
  1. Memory and garbage collection
  • Monitor memory growth over time; unexpected growth suggests leaks.
  • Use objgraph to find retained objects and circular references.
  • Check for large object retention or unbounded caches.

Output Requirements

For each finding provide:

  • Measurement (baseline throughput, latency, memory).
  • Profiling evidence (call graph, timeline, memory snapshot).
  • Root cause (GIL, algorithm, I/O, import, memory).
  • Optimization strategy and expected improvement.
  • Effort and risk assessment.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.