Skip to content

Instantly share code, notes, and snippets.

@futzlarson
Last active March 5, 2026 04:17
Show Gist options
  • Select an option

  • Save futzlarson/c8567a6d81f67b740ccb5b4682107124 to your computer and use it in GitHub Desktop.

Select an option

Save futzlarson/c8567a6d81f67b740ccb5b4682107124 to your computer and use it in GitHub Desktop.
Performance skill
name description disable-model-invocation argument-hint context agent
performance
Analyzes the codebase for easy-win performance improvements. Activate when the user asks about performance, slow queries, N+1 problems, missing indexes, optimization, or wants to find quick wins.
true
[top-n]
fork
Explore

Performance Analysis

Analyze this Laravel codebase and identify the top $ARGUMENTS easy-win performance improvements. Default to top 5 if no number is given.

What to Look For

Work through each category below, searching the codebase thoroughly. Prioritize findings by estimated impact vs effort — favour low-effort, high-impact wins.

1. N+1 Query Problems

  • Eloquent relationships loaded inside loops without eager loading
  • Missing with() / load() calls on collections
  • Repeated calls to relationship accessors across a collection

2. Missing Database Indexes

  • Foreign key columns without indexes
  • Columns used in frequent WHERE, ORDER BY, or JOIN clauses in queries/scopes that lack indexes
  • Use database-schema tool to inspect existing indexes before flagging

3. Unoptimized Eloquent Queries

  • select * when only a few columns are needed
  • ->get() on large tables without pagination or limits
  • ->count() or ->exists() done inefficiently (e.g. loading a full collection just to count it)
  • Missing ->chunk() or ->lazy() for bulk operations

4. Repeated or Unnecessary Computation

  • Expensive operations called repeatedly in loops
  • Computed values that could be cached or memoized
  • Redundant database calls for the same data within a single request

5. Missing Caching

  • Config, permission, or role lookups that run on every request
  • Expensive aggregations that rarely change
  • Opportunities for Cache::remember() around slow queries

6. Slow Blade / View Rendering

  • Heavy logic or queries inside Blade templates
  • Missing use of @once for repeated components
  • Synchronous operations that could be deferred

7. Queue Opportunities

  • Sending emails, notifications, or webhooks synchronously in request cycles
  • Heavy operations (PDF generation, report exports) blocking HTTP responses

Output Format

Present findings as a numbered list ranked by impact. For each finding:

  1. Title — Short description of the issue
  2. Location — File path and line number(s)
  3. Problem — What's slow and why
  4. Fix — Concrete code change or approach to resolve it
  5. EffortLow / Medium / High
  6. ImpactLow / Medium / High
  7. Git blame - Who committed the code, when and link to commit

Focus only on real findings backed by code you've read — do not speculate. If you find fewer than $ARGUMENTS genuine issues, report only what you find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment