Skill Tracer
Skills › gstack › review › performance.md

performance.md

52 lines · review/specialists/performance.md at 3f79d81

Open on GitHub
1# Performance Specialist Review Checklist
2
3Scope: When SCOPE_BACKEND=true OR SCOPE_FRONTEND=true
4Output: JSON objects, one finding per line. Schema:
5{"severity":"CRITICAL|INFORMATIONAL","confidence":N,"path":"file","line":N,"category":"performance","summary":"...","fix":"...","fingerprint":"path:line:performance","specialist":"performance"}
6Optional: line, fix, fingerprint, evidence, test_stub.
7If no findings: output `NO FINDINGS` and nothing else.
8
9---

Performance Specialist Review Checklist

Scope: When SCOPE_BACKEND=true OR SCOPE_FRONTEND=true Output: JSON objects, one finding per line. Schema: {"severity":"CRITICAL|INFORMATIONAL","confidence":N,"path":"file","line":N,"category":"performance","summary":"...","fix":"...","fingerprint":"path:line:performance","specialist":"performance"} Optional: line, fix, fingerprint, evidence, test_stub. If no findings: output NO FINDINGS and nothing else.


Raw lines 1 to 10
11## Categories
13### N+1 Queries
14- ActiveRecord/ORM associations traversed in loops without eager loading (.includes, joinedload, include)
15- Database queries inside iteration blocks (each, map, forEach) that could be batched
16- Nested serializers that trigger lazy-loaded associations
17- GraphQL resolvers that query per-field instead of batching (check for DataLoader usage)

N+1 Queries

  • ActiveRecord/ORM associations traversed in loops without eager loading (.includes, joinedload, include)
  • Database queries inside iteration blocks (each, map, forEach) that could be batched
  • Nested serializers that trigger lazy-loaded associations
  • GraphQL resolvers that query per-field instead of batching (check for DataLoader usage)
Raw lines 13 to 18
19### Missing Database Indexes
20- New WHERE clauses on columns without indexes (check migration files or schema)
21- New ORDER BY on non-indexed columns
22- Composite queries (WHERE a AND b) without composite indexes
23- Foreign key columns added without indexes

Missing Database Indexes

  • New WHERE clauses on columns without indexes (check migration files or schema)
  • New ORDER BY on non-indexed columns
  • Composite queries (WHERE a AND b) without composite indexes
  • Foreign key columns added without indexes
Raw lines 19 to 24
25### Algorithmic Complexity
26- O(n^2) or worse patterns: nested loops over collections, Array.find inside Array.map
27- Repeated linear searches that could use a hash/map/set lookup
28- String concatenation in loops (use join or StringBuilder)
29- Sorting or filtering large collections multiple times when once would suffice

Algorithmic Complexity

  • O(n^2) or worse patterns: nested loops over collections, Array.find inside Array.map
  • Repeated linear searches that could use a hash/map/set lookup
  • String concatenation in loops (use join or StringBuilder)
  • Sorting or filtering large collections multiple times when once would suffice
Raw lines 25 to 30
31### Bundle Size Impact (Frontend)
32- New production dependencies that are known-heavy (moment.js, lodash full, jquery)
33- Barrel imports (import from 'library') instead of deep imports (import from 'library/specific')
34- Large static assets (images, fonts) committed without optimization
35- Missing code splitting for route-level chunks

Bundle Size Impact (Frontend)

  • New production dependencies that are known-heavy (moment.js, lodash full, jquery)
  • Barrel imports (import from 'library') instead of deep imports (import from 'library/specific')
  • Large static assets (images, fonts) committed without optimization
  • Missing code splitting for route-level chunks
Raw lines 31 to 36
37### Rendering Performance (Frontend)
38- Fetch waterfalls: sequential API calls that could be parallel (Promise.all)
39- Unnecessary re-renders from unstable references (new objects/arrays in render)
40- Missing React.memo, useMemo, or useCallback on expensive computations
41- Layout thrashing from reading then writing DOM properties in loops
42- Missing loading="lazy" on below-fold images

Rendering Performance (Frontend)

  • Fetch waterfalls: sequential API calls that could be parallel (Promise.all)
  • Unnecessary re-renders from unstable references (new objects/arrays in render)
  • Missing React.memo, useMemo, or useCallback on expensive computations
  • Layout thrashing from reading then writing DOM properties in loops
  • Missing loading="lazy" on below-fold images
Raw lines 37 to 43
44### Missing Pagination
45- List endpoints that return unbounded results (no LIMIT, no pagination params)
46- Database queries without LIMIT that grow with data volume
47- API responses that embed full nested objects instead of IDs with expansion

Missing Pagination

  • List endpoints that return unbounded results (no LIMIT, no pagination params)
  • Database queries without LIMIT that grow with data volume
  • API responses that embed full nested objects instead of IDs with expansion
Raw lines 44 to 48
49### Blocking in Async Contexts
50- Synchronous I/O (file reads, subprocess, HTTP requests) inside async functions
51- time.sleep() / Thread.sleep() inside event-loop-based handlers
52- CPU-intensive computation blocking the main thread without worker offload

Blocking in Async Contexts

  • Synchronous I/O (file reads, subprocess, HTTP requests) inside async functions
  • time.sleep() / Thread.sleep() inside event-loop-based handlers
  • CPU-intensive computation blocking the main thread without worker offload
Raw lines 49 to 52