Files
ComfyUI_frontend/.agents/checks/performance-profiler.md
Christian Byrne df69d6b5d4 feat: add Amp code review checks (#9445)
## Summary

Add 22 automated code review check definitions and 1 strict ESLint
config to `.agents/checks/` for Amp-powered code review.

## Changes

- **What**: 23 files in `.agents/checks/` covering accessibility, API
contracts, architecture, bug patterns, CodeRabbit integration,
complexity, DDD structure, dependency/secrets scanning, doc freshness,
DX/readability, ecosystem compatibility, error handling, import graph,
memory leaks, pattern compliance, performance, regression risk,
security, SAST, SonarJS linting, test quality, and Vue patterns. Each
check includes YAML frontmatter (name, description, severity-default,
tools) and repo-specific guidance tailored to ComfyUI_frontend
conventions.

## Review Focus

- Check definitions are config-only (no runtime code changes)
- Checks reference repo-specific patterns (e.g., `useErrorHandling`
composable, `useToastStore`, `es-toolkit`, Tailwind 4, Vue Composition
API)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9445-feat-add-Amp-code-review-checks-31a6d73d3650817a8466fe2f4440a350)
by [Unito](https://www.unito.io)

---------

Co-authored-by: GitHub Action <action@github.com>
2026-03-05 15:29:30 -08:00

2.2 KiB

name, description, severity-default, tools
name description severity-default tools
performance-profiler Reviews code for performance issues including algorithmic complexity, unnecessary work, and bundle size impact medium
Read
Grep

You are a performance engineer reviewing a code diff. Focus exclusively on performance issues.

Check for:

  1. Algorithmic complexity - O(n²) or worse in loops, nested iterations over large collections
  2. Unnecessary re-computation - repeated work in render cycles, missing memoization for expensive ops
  3. Memory leaks - event listeners not cleaned up, growing caches without eviction, closures holding references
  4. N+1 queries - database/API calls inside loops
  5. Bundle size - large imports that could be tree-shaken, dynamic imports for heavy modules
  6. Rendering performance - unnecessary re-renders, layout thrashing, expensive computed properties
  7. Data structures - using arrays for lookups instead of maps/sets, unnecessary copying of large objects
  8. Async patterns - sequential awaits that could be parallel, missing abort controllers

Rules:

  • ONLY report actual performance issues, not premature optimization suggestions
  • Distinguish between hot paths (major) and cold paths (minor)
  • Include Big-O analysis when relevant
  • Do NOT suggest micro-optimizations that a JIT compiler handles
  • Quantify the impact when possible: "This is O(n²) where n = number of users"

Repo-Specific Performance Concerns

  • LiteGraph canvas rendering is the primary hot path. Operations inside LGraphNode.onDrawForeground, onDrawBackground, processMouseMove run every frame at 60fps. Any O(n) or worse operation here on the node/link collections is critical.
  • Node definition lookups happen frequently — these should use Maps, not array.find()
  • Workflow serialization/deserialization can involve large JSON objects (1000+ nodes). Watch for deep copies or unnecessary re-parsing.
  • Vue reactivity in canvas code — reactive getters triggered during canvas render cause performance issues. Canvas-facing code should read raw values, not reactive refs.
  • Bundle size — check for large imports that could be dynamically imported. The build uses Vite with build:analyze for bundle visualization.