Compare commits

...

5 Commits

Author SHA1 Message Date
GitHub Action
4441520e71 [automated] Apply ESLint and Oxfmt fixes 2026-03-27 10:38:59 +00:00
Christian Byrne
f26e76ffe0 fix: increase subgraph node size to meet test asset minimum
Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI_frontend/pull/10480#discussion_r2994293950
2026-03-27 03:36:02 -07:00
bymyself
d5d9038c89 refactor: use shared fixtures in subgraph transition test
- Remove redundant comment (code is already expressive)
- Use existing waitForNodes(80) instead of inline expect/toPass
- Use subgraph.exitViaBreadcrumb() instead of manual exit+verify
- Replace inline nextFrame loops with idleFrames() helper

Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI_frontend/pull/10480#discussion_r2990260133
https://github.com/Comfy-Org/ComfyUI_frontend/pull/10480#discussion_r2990261108
https://github.com/Comfy-Org/ComfyUI_frontend/pull/10480#discussion_r2990263310
2026-03-26 04:35:11 -07:00
bymyself
3f5ac787cf refactor: add idleFrames helper to ComfyPage
Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI_frontend/pull/10480#discussion_r2990258831
https://github.com/Comfy-Org/ComfyUI_frontend/pull/10480#discussion_r2990264717
2026-03-26 04:34:58 -07:00
bymyself
3c8e490e01 test: add perf test for subgraph transition bottleneck
Add a @perf test measuring the cost of entering a subgraph containing
80 interior nodes. This establishes a CI baseline for taskDurationMs,
layouts, and TBT during the synchronous mount/unmount cycle.

Includes a test workflow asset (large-subgraph-80-nodes.json) with a
single subgraph node whose interior contains 80 Note nodes.

This is PR 1 of 2. The optimization fix will follow in a separate PR
once this baseline is established on main.
2026-03-24 16:48:53 -07:00
3 changed files with 1485 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -347,6 +347,12 @@ export class ComfyPage {
})
}
async idleFrames(count: number) {
for (let i = 0; i < count; i++) {
await this.nextFrame()
}
}
async delay(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms))
}

View File

@@ -300,6 +300,36 @@ test.describe('Performance', { tag: ['@perf'] }, () => {
})
})
test('subgraph transition (enter and exit)', async ({ comfyPage }) => {
// Load workflow with a subgraph containing 80 interior nodes.
// Entering the subgraph unmounts root nodes and mounts all 80 interior
// nodes synchronously — this is the bottleneck we're measuring.
await comfyPage.workflow.loadWorkflow('subgraphs/large-subgraph-80-nodes')
await comfyPage.idleFrames(30)
await comfyPage.vueNodes.enterSubgraph()
await comfyPage.vueNodes.waitForNodes(80)
await comfyPage.idleFrames(30)
// Exit back to root graph before measuring a fresh enter/exit cycle
await comfyPage.subgraph.exitViaBreadcrumb()
await comfyPage.idleFrames(10)
// Start measuring the enter transition
await comfyPage.perf.startMeasuring()
await comfyPage.vueNodes.enterSubgraph()
await comfyPage.vueNodes.waitForNodes(80)
await comfyPage.idleFrames(30)
const m = await comfyPage.perf.stopMeasuring('subgraph-transition-enter')
recordMeasurement(m)
console.log(
`Subgraph enter (80 nodes): ${m.taskDurationMs.toFixed(0)}ms task, ${m.layouts} layouts, TBT=${m.totalBlockingTimeMs.toFixed(0)}ms`
)
})
test('workflow execution', async ({ comfyPage }) => {
// Uses lightweight PrimitiveString → PreviewAny workflow (no GPU needed)
await comfyPage.workflow.loadWorkflow('execution/partial_execution')