Skip to content
Back to skills

Elixir Performance Review

ASecurity

Reviews Elixir code for performance issues including GenServer bottlenecks, memory usage, ETS concurrency, and task supervision. Use when reviewing high-throughput code or investigating BEAM performance issues.

  • 92 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
developmentsqldatabaseperformance

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned November 26, 2026

npx -y skills add existential-birds/beagle --skill elixir-performance-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Elixir Performance Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Elixir Performance Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/existential-birds-elixir-performance-review/badge)](https://www.skillsdirectory.com/skills/existential-birds-elixir-performance-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: elixir-performance-review
description: Reviews Elixir code for performance issues including GenServer bottlenecks, memory usage, ETS concurrency, and task supervision. Use when reviewing high-throughput code or investigating BEAM performance issues.
---

# Elixir Performance Review

## Quick Reference

| Issue Type | Reference |
|------------|-----------|
| Mailbox overflow, `PartitionSupervisor`, blocking calls | [references/genserver-bottlenecks.md](references/genserver-bottlenecks.md) |
| ETS concurrency, `:persistent_term`, `:atomics` | [references/ets-patterns.md](references/ets-patterns.md) |
| Sub-binary retention, `Repo.stream`, large messages | [references/memory.md](references/memory.md) |
| `Task.Supervisor`, `NimblePool`, `DynamicSupervisor` | [references/concurrency.md](references/concurrency.md) |

## Review Checklist

### GenServer
- [ ] Not a single-process bottleneck for all requests (use `PartitionSupervisor` or ETS where appropriate)
- [ ] No blocking operations in `handle_call`/`handle_cast`
- [ ] Proper timeout configuration (`catch :exit, {:timeout, _}` on caller)
- [ ] Consider ETS / `:persistent_term` / `:atomics` for read-heavy state or high-contention counters

### Memory
- [ ] Sub-binaries extracted from >64-byte binaries copied with `:binary.copy/1` before long-lived retention
- [ ] Streams (`File.stream!/1`, `Repo.stream/2` inside `Repo.transaction/2`) used for large data transformations
- [ ] No unbounded data accumulation in GenServer state or ETS TTL tables

### Concurrency
- [ ] `Task.Supervisor` for dynamic tasks (not raw `Task.async` or unlinked `Task.start`)
- [ ] Process spawning bounded (`DynamicSupervisor` with `max_children` in `init/1`, `NimblePool`, `async_stream_nolink`)
- [ ] 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 |

## Gates — before reporting

Do these **in order** for the performance review. Do not publish findings until each step passes.

1. **Protocol loaded** — Read the `review-verification-protocol` skill ([review-verification-protocol](../review-verification-protocol/SKILL.md)) and apply its checks for each finding (hot paths, concurrency, resource use). **Pass:** For every substantive finding, you can name which protocol subsection you satisfied or state **N/A** with reason (e.g. pure reference to this skill’s Valid Patterns).
2. **Anchored evidence** — **Pass:** Each finding includes a concrete locator: `path:line` (or line range), or `Module.function/arity` plus a short quoted snippet from the file.
3. **Performance claims** — For anything under [Context-Sensitive Rules](#context-sensitive-rules), or any claim of bottleneck, N+1, unbounded growth, or heavy memory/binary cost, **Pass:** You state the **observed or measured** fact that meets “Flag ONLY IF” (e.g. rate, item count, ratio), or attach an artifact (profiler output, SQL/log excerpt, `grep`/search scope)—otherwise downgrade to **question** / **suspected** with what was not verified.

## Before Submitting Findings

Complete **Gates — before reporting** (section above) first; the `review-verification-protocol` skill ([review-verification-protocol](../review-verification-protocol/SKILL.md)) is mandatory input to those gates.

Files in this skill

  • SKILL.md2.1 KB
  • references/concurrency.md2.6 KB
  • references/ets-patterns.md2.5 KB
  • references/genserver-bottlenecks.md3 KB
  • references/memory.md2.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.