perf-fix-with-proof

Ships performance fixes as stacked PRs with CI-proven improvement deltas.

2.0k|679|Updated Jun 13, 2024
One-click install
npx skills add https://github.com/Comfy-Org/ComfyUI_frontend --skill perf-fix-with-proof
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: perf-fix-with-proof
Source: https://github.com/Comfy-Org/ComfyUI_frontend/tree/main/.claude/skills/perf-fix-with-proof
Command: npx skills add https://github.com/Comfy-Org/ComfyUI_frontend --skill perf-fix-with-proof

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Performance optimizations are hard to prove in CI because a new @perf test added in the same PR as the fix has no baseline on main, so no delta can be computed. This Skill solves that by splitting the work into two stacked PRs: one that establishes the baseline test on main, and one that lands the fix so CI automatically reports the improvement.

Core Features & Use Cases

  • Stacked PR workflow: Guides creation of PR1 (test-only, establishes baseline on main) and PR2 (the fix, compared against that baseline by the ci-perf-report.yaml workflow).
  • @perf test authoring: Provides templates and helpers (comfyPage.perf.startMeasuring/stopMeasuring, nextFrame, workflow loading) for writing Playwright performance tests that capture style recalcs, layouts, task duration, and heap delta.
  • CI verification: Explains how the ci-perf-report.yaml workflow posts a delta report comment proving the improvement.
  • Use Case: You are fixing DOM widget reactive mutation overhead (backlog #8). You write a @perf test that idles 120 frames measuring style recalcs, merge it as PR1, then land the fix as PR2 and let CI show the -97% style recalc delta.

Quick Start

Ask the AI to create a stacked PR pair that adds a @perf baseline test for your bottleneck first and then ships the optimization fix with CI-proven improvement.

Frequently Asked Questions about perf-fix-with-proof

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prove a performance fix works in CI?

Split the work into two stacked PRs: PR1 adds only the @perf test and merges to main to establish a baseline, then PR2 adds the fix. The ci-perf-report.yaml workflow compares PR2 metrics against the baseline and posts a delta report comment.

How do I write a Playwright performance test for ComfyUI?

Add a test tagged @perf in browser_tests/tests/performance.spec.ts that loads a workflow, calls comfyPage.perf.startMeasuring(), stresses the bottleneck across many frames, then calls stopMeasuring(name) and recordMeasurement(m) to capture metrics.

Why does my perf test show no delta in the CI report?

The CI workflow compares PR metrics against the base branch baseline. If the @perf test was added in the same PR as the fix, no baseline exists on main yet, so no delta can be computed. Merge the test first in a separate PR.

What performance metrics can the ComfyUI test suite measure?

The PerformanceHelper captures style recalculation count and duration, forced layout count and duration, total main-thread task duration, and heap memory delta via Chrome DevTools Protocol metrics.

When should I not use the stacked PR approach for perf fixes?

If a @perf test covering the bottleneck already exists on main, the baseline is already established and you can ship the fix directly in a single PR. Stacking is only needed when introducing a new measurement.