Elixir调优

elixir-performance-review

by anderskev

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

3.8k其他未扫描2026年3月23日

安装

claude skill add --url github.com/openclaw/skills/tree/main/skills/anderskev/elixir-performance-review

文档

Elixir Performance Review

Quick Reference

Issue TypeReference
Mailbox overflow, blocking callsreferences/genserver-bottlenecks.md
When to use ETS, read/write concurrencyreferences/ets-patterns.md
Binary handling, large messagesreferences/memory.md
Task patterns, flow controlreferences/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

IssueFlag ONLY IF
GenServer bottleneckHandles > 1000 req/sec OR blocking I/O in callbacks
Use streamsProcessing > 10k items OR reading large files
Use ETSRead:write ratio > 10:1 AND concurrent access

Before Submitting Findings

Load and follow review-verification-protocol before reporting any issue.

相关 Skills

claude-api

by anthropic

热门

Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.

其他
安全111.1k

Detect scam tokens on Solana before you trade. Checks ticker patterns, token age, and known scam mints. Read-only — no wallet signing required.

其他
未扫描3.8k

revenue-studio

by amoldericksoans

A revenue-first solofounder studio that watches markets, finds monetizable pain, validates offers, ships narrow products, and compounds commercial memory across launches. Uses massive parallel agent orchestration with 8 layers: Signal Mesh, Extraction, Opportunity Graph, Cofounder Council, Revenue Lab, Build Studio, Launch Loop, and Portfolio Allocator.

其他
未扫描3.8k

评论