Maintenance in progress: we are indexing a large batch of new skills. Some pages may load slowly or briefly show no results. Nothing is lost, and everything is back to normal within the hour.

Plain Optimize

Captures and analyzes performance traces to identify slow queries and N+1 problems. Use when analyzing performance or optimizing database queries.

majiayu000 275d115 2 files · 1.7 KB Updated 567 repo stars

File contents

Performance Optimization Workflow

1. Capture Traces

Make a request with tracing enabled:

uv run plain request /path --user 1 --header "Observer: persist"

2. Find Traces

uv run plain observer traces --request-id <request-id>

3. Analyze Trace

uv run plain observer trace <trace-id> --json

4. Identify Bottlenecks

Look for:

  • N+1 queries (many similar queries)
  • Slow database queries
  • Missing indexes
  • Unnecessary work in hot paths

5. Apply Fixes

  • Add select_related() / prefetch_related() for N+1
  • Add database indexes for slow queries
  • Cache expensive computations

6. Verify Improvement

Re-run the trace and compare.

majiayu000/claude-skill-registry-data/tree/main/data/plain-optimize commit 275d115b6c

Frequently asked questions

npx skillmds add majiayu000/plain-optimize