performant-python skill
Optimizes Python services for high concurrency and low latency using asynchronous patterns, efficient memory management, and performance profiling.
- GitHub stars
- 23
- Files
- 4
- Last commit
- Nov 11, 2026
- License
- CC-BY-SA-4.0
- Allowed tools
- —
What does the performant-python skill do?
performant-python optimizes Python services for high concurrency and low latency using asynchronous patterns, efficient memory management, and performance profiling.
Summary generated from the skill's SKILL.md.
About the performant-python skill
Optimizing Python services for high concurrency and low latency is the primary function of this skill. Developers building scalable backends with FastAPI or Asyncio can load this tool to identify bottlenecks and implement asynchronous patterns. It provides specific guidance on replacing the default asyncio loop with uvloop and managing CPU-bound tasks using run_in_executor to prevent event loop blocking.
When an agent uses this skill, it produces architectural reviews, scalability roadmaps, and benchmark reports. It focuses on memory efficiency through techniques like using __slots__ and generator patterns, as well as faster serialization using ORJSONResponse or Pydantic v2. The skill relies on profiling tools such as cProfile, Py-Spy, and Scalene to analyze code paths and resource usage. It also suggests deployment strategies like using Gunicorn with UvicornWorker and implementing connection pooling with httpx to ensure high-performance execution.
What an agent can do with it
- 1Identify performance bottlenecksFind the hot paths in a running process using sampling profiling tools.
- 2Reduce memory footprintOptimize frequently instantiated classes to decrease memory usage and increase speed.
- 3Validate speed improvementsVerify that code changes actually improve response times under heavy load.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the performant-python skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the performant-python skill in Plugin
/plugin marketplace add andreibesleaga/GABBE /plugin install gabbe-coding@gabbe
Install the performant-python skill in Claude Code
~/.claude/skills/performant-python/SKILL.md
$ npx degit andreibesleaga/GABBE/plugins/gabbe-coding/skills/performant-python ~/.claude/skills/performant-pythonInstall the performant-python skill in Claude Code (project)
.claude/skills/performant-python/SKILL.md
$ npx degit andreibesleaga/GABBE/plugins/gabbe-coding/skills/performant-python .claude/skills/performant-pythonInstall the performant-python skill in Codex
~/.agents/skills/performant-python/SKILL.md
$ npx degit andreibesleaga/GABBE/plugins/gabbe-coding/skills/performant-python ~/.agents/skills/performant-pythonInstall the performant-python skill in Gemini CLI
~/.gemini/skills/performant-python/SKILL.md
$ npx degit andreibesleaga/GABBE/plugins/gabbe-coding/skills/performant-python ~/.gemini/skills/performant-pythonInstall the performant-python skill in Claude.ai
npx degit andreibesleaga/GABBE/plugins/gabbe-coding/skills/performant-python performant-python && zip -r performant-python.zip performant-python # claude.ai → Customize → Skills → + → Create skill → Upload a skill → performant-python.zip
Automated checks
Ran Nov 14, 2026Full report →Not verified yet. A skill needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachableandreibesleaga/gabbe/plugins/gabbe-coding/skills/performant-python is public and reachablegithub.com/andreibesleaga/gabbe/tree/HEAD/plugins/gabbe-codi ↗Pass
- Open source license (OSI)CC-BY-SA-4.0 is not OSI-approvedspdx.org/licenses/CC-BY-SA-4.0.html ↗Finding
- Commit or release in the last yearLast commit 2026-11-11github.com/andreibesleaga/gabbe/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/andreibesleaga/gabbe/blob/HEAD/plugins/gabbe-codi ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/andreibesleaga/gabbe/blob/HEAD/plugins/gabbe-codi ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 66 linesgithub.com/andreibesleaga/gabbe/blob/HEAD/plugins/gabbe-codi ↗Pass
SKILL.md
View on GitHubPerformant Python Skill
Goal
Building high-concurrency, low-latency Python services by leveraging asynchronous patterns, optimized runtimes, and efficient memory management.
Capabilities
1. Asynchronous Mastery (Asyncio & FastAPI)
- Non-blocking I/O: Use
async/awaitfor all network and disk I/O. Userun_in_executorfor CPU-bound tasks to avoid blocking the event loop. - Event Loop Tuning: Use
uvloopas the drop-in replacement for the default asyncio loop for significant speedups. - Concurrent Execution: Use
asyncio.gather()orasyncio.TaskGroup(Python 3.11+) for parallel I/O operations.
2. Database & Data Handling
- Async Drivers: Use
asyncpgfor PostgreSQL oraiomysql. Use SQLAlchemy/Tortoise with async support. - Serialization: Use
ORJSONResponseorUJSONResponsein FastAPI for faster JSON encoding/decoding. - Efficient Models: Use Pydantic v2 for its Rust-based speed. Use
.model_dump(include={...})to minimize data transfer.
3. Memory & Resource Optimization
- Slot Classes: Use
__slots__in frequently instantiated classes to reduce memory footprint and increase attribute access speed. - Generator Patterns: Use
generatorsandyieldfor processing large datasets to keep memory usage constant (O(1)). - Garbage Collection: Tune
gcthresholds if necessary, but prioritize object reuse to minimize pressure.
4. Deployment & Performance Runtimes
- Process Management: Use Gunicorn with
UvicornWorkerto scale across CPU cores. - Connection Pooling: Always implement pooling for DB and HTTP clients (e.g.,
httpxinstead ofrequests). - Middleware Overhead: Audit and minimize middleware; each layer adds latency to every request.
5. Profiling & Monitoring
- Deterministic Profiling: Use
cProfilefor code path analysis. - Sampling Profiling: Use
Py-SpyorScalenefor production-safe, low-overhead profiling. - APM: Integrate with Prometheus/Grafana or Datadog for real-time latency and throughput tracking.
Steps
- Identify Blockers: Use
Py-Spyto find the hot paths in a running process. - Async Audit: Ensure no synchronous libraries (like
requestsor standardpsycopg2) are used in an async context. - Pydantic Check: Upgrade to V2 and optimize model validation constraints.
- Benchmark: Use
Locustork6to verify speed improvements under load.
Deliverables
ARCHITECTURE_REVIEW_TEMPLATE.md: Analysis of blocking calls and memory architecture.SCALABILITY_ANALYSIS_TEMPLATE.md: Roadmap for converting sync logic to async.BENCHMARK_REPORT_TEMPLATE.md: Response time comparisons (Before/After load testing).
Security & Guardrails
1. Async Hazards
- Race Conditions: Be cautious with shared state (globals) in async contexts; use
asyncio.Lockwhere necessary. - Loop Blocking: Never run
time.sleep()or heavy math in the main thread of an async app.
2. Data Security
- Parameterization: Ensure all DB queries are parameterized, especially when using raw SQL via async drivers.
3. Agent Guardrails
- No Over-optimization: Don't use
cythonornumbaunless the pure Python/FastAPI path is fully optimized and still proves insufficient. - Versioning: Ensure compatibility with Python 3.9+ for modern async features.
Files in this skill
4performant-python skill questions
How do I install the performant-python skill in Claude Code?
Run npx degit andreibesleaga/GABBE/plugins/gabbe-coding/skills/performant-python ~/.claude/skills/performant-python. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the performant-python skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
How can I speed up the asyncio event loop?
You can use uvloop as a drop-in replacement for the default asyncio loop to achieve significant speedups.
What should I use to reduce memory footprint in frequently instantiated classes?
Using __slots__ in your classes can reduce the memory footprint and increase attribute access speed.
How can I profile a running process in production safely?
For production-safe, low-overhead profiling, you should use sampling profilers like Py-Spy or Scalene.
What are the risks of using shared state in an async context?
Shared state like globals can lead to race conditions; you should use asyncio.Lock where necessary to manage them.