Agent skill
elixir-performance-review
Reviews Elixir code for performance issues including GenServer bottlenecks, memory usage, and concurrency patterns. Use when reviewing high-throughput code or investigating performance issues.
Install this agent skill to your Project
npx add-skill https://github.com/existential-birds/beagle/tree/main/plugins/beagle-elixir/skills/elixir-performance-review
SKILL.md
Elixir Performance Review
Quick Reference
| Issue Type | Reference |
|---|---|
| Mailbox overflow, blocking calls | references/genserver-bottlenecks.md |
| When to use ETS, read/write concurrency | references/ets-patterns.md |
| Binary handling, large messages | references/memory.md |
| Task patterns, flow control | references/concurrency.md |
Review Checklist
GenServer
- Not a single-process bottleneck for all requests
- No blocking operations in handle_call/cast
- Proper timeout configuration
- Consider ETS for read-heavy state
Memory
- Large binaries not copied between processes
- Streams used for large data transformations
- No unbounded data accumulation
Concurrency
- Task.Supervisor for dynamic tasks (not raw Task.async)
- No unbounded process spawning
- Proper backpressure for message producers
Database
- Preloading to avoid N+1 queries
- Pagination for large result sets
- Indexes for frequent queries
Valid Patterns (Do NOT Flag)
- Single GenServer for low-throughput - Not all state needs horizontal scaling
- Synchronous calls for critical paths - Consistency may require it
- In-memory state without ETS - ETS has overhead for small state
- Enum over Stream for small collections - Stream overhead not worth it
Context-Sensitive Rules
| Issue | Flag ONLY IF |
|---|---|
| GenServer bottleneck | Handles > 1000 req/sec OR blocking I/O in callbacks |
| Use streams | Processing > 10k items OR reading large files |
| Use ETS | Read:write ratio > 10:1 AND concurrent access |
Before Submitting Findings
Load and follow review-verification-protocol before reporting any issue.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
review-python
Comprehensive Python/FastAPI backend code review with optional parallel agents
review-verification-protocol
Mandatory verification steps for all code reviews to reduce false positives. Load this skill before reporting ANY code review findings.
sqlalchemy-code-review
Reviews SQLAlchemy code for session management, relationships, N+1 queries, and migration patterns. Use when reviewing SQLAlchemy 2.0 code, checking session lifecycle, relationship() usage, or Alembic migrations.
fastapi-code-review
Reviews FastAPI code for routing patterns, dependency injection, validation, and async handlers. Use when reviewing FastAPI apps, checking APIRouter setup, Depends() usage, or response models.
pytest-code-review
Reviews pytest test code for async patterns, fixtures, parametrize, and mocking. Use when reviewing test_*.py files, checking async test functions, fixture usage, or mock patterns.
postgres-code-review
Reviews PostgreSQL code for indexing strategies, JSONB operations, connection pooling, and transaction safety. Use when reviewing SQL queries, database schemas, JSONB usage, or connection management.
Didn't find tool you were looking for?