Install
$ agentstack add skill-caraya-agent-skills-python-performance ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo 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.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
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 →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
- CPU profiling
cProfile:python -m cProfile -s cumulative script.pyfor deterministic profiling.py-spy: Sampling profiler; attach to running process without instrumentation.pyflame: Statistical profiler; good for production use.
- Memory profiling
memory_profiler: Line-by-line memory with@profiledecorator.objgraph: Detect memory leaks by visualizing object references.tracemalloc: Built-in; track allocations over time.
- Async and I/O analysis
asynciodebug mode: Setasyncio.run(..., debug=True)orPYTHONASYNCDEBUG=1.py-spywith--idle: See where time is spent (I/O wait vs. CPU).
Checklist
- GIL and threading
- Is the bottleneck CPU-bound (GIL-limited) or I/O-bound?
- For CPU-bound: use
multiprocessingor Cython, not threading. - For I/O-bound: use async/await (
asyncio) or thread pools, notthreading.Thread.
- 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.
- 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).
- Memory and garbage collection
- Monitor memory growth over time; unexpected growth suggests leaks.
- Use
objgraphto 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.
- Author: caraya
- Source: caraya/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.