mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
feat: add executionIdToNodeLocatorId call counter behind feature flag
Add dev-only instrumentation to count how many times
executionIdToNodeLocatorId is called per execution run. This
provides a baseline measurement for evaluating the impact of
caching this function's results, in a later PR.
Gated behind the feature flag
"ff:expose_executionId_to_node_locator_id_cache_counters"
(localStorage). Uses the existing getDevOverride utility which
is tree-shaken from production builds via import.meta.env.DEV.
Enable in browser console:
localStorage.setItem(
'ff:expose_executionId_to_node_locator_id_cache_counters',
'true'
)
On execution completion, logs the total call count to
console.warn. No reload needed to toggle.
**feat**: Allow measurement of caching impact, behind a flag
**impact**: None unless activated, then just some logging
There isn't one. I don't have access to AmpCode or Unito.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@comfyorg/comfyui-frontend",
|
||||
"version": "1.41.6",
|
||||
"version": "1.42.0",
|
||||
"private": true,
|
||||
"description": "Official front-end implementation of ComfyUI",
|
||||
"homepage": "https://comfy.org",
|
||||
|
||||
@@ -31,6 +31,7 @@ import { useNodeOutputStore } from '@/stores/imagePreviewStore'
|
||||
import { useJobPreviewStore } from '@/stores/jobPreviewStore'
|
||||
import { useExecutionErrorStore } from '@/stores/executionErrorStore'
|
||||
import type { NodeLocatorId } from '@/types/nodeIdentification'
|
||||
import { getDevOverride } from '@/utils/devFeatureFlagOverride'
|
||||
import { classifyCloudValidationError } from '@/utils/executionErrorUtil'
|
||||
import { executionIdToNodeLocatorId } from '@/utils/graphTraversalUtil'
|
||||
|
||||
@@ -67,6 +68,16 @@ export const useExecutionStore = defineStore('execution', () => {
|
||||
|
||||
const initializingJobIds = ref<Set<string>>(new Set())
|
||||
|
||||
let executionIdToLocatorCallCount = 0
|
||||
|
||||
function isLocatorCacheCounterEnabled(): boolean {
|
||||
return (
|
||||
getDevOverride<boolean>(
|
||||
'expose_executionId_to_node_locator_id_cache_counters'
|
||||
) ?? false
|
||||
)
|
||||
}
|
||||
|
||||
const mergeExecutionProgressStates = (
|
||||
currentState: NodeProgressState | undefined,
|
||||
newState: NodeProgressState
|
||||
@@ -106,6 +117,9 @@ export const useExecutionStore = defineStore('execution', () => {
|
||||
const parts = String(state.display_node_id).split(':')
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
const executionId = parts.slice(0, i + 1).join(':')
|
||||
if (isLocatorCacheCounterEnabled()) {
|
||||
executionIdToLocatorCallCount++
|
||||
}
|
||||
const locatorId = executionIdToNodeLocatorId(app.rootGraph, executionId)
|
||||
if (!locatorId) continue
|
||||
|
||||
@@ -424,6 +438,12 @@ export const useExecutionStore = defineStore('execution', () => {
|
||||
* Reset execution-related state after a run completes or is stopped.
|
||||
*/
|
||||
function resetExecutionState(jobIdParam?: string | null) {
|
||||
if (isLocatorCacheCounterEnabled() && executionIdToLocatorCallCount > 0) {
|
||||
console.warn(
|
||||
`[executionStore] executionIdToNodeLocatorId calls this run: ${executionIdToLocatorCallCount}`
|
||||
)
|
||||
executionIdToLocatorCallCount = 0
|
||||
}
|
||||
nodeProgressStates.value = {}
|
||||
const jobId = jobIdParam ?? activeJobId.value ?? null
|
||||
if (jobId) {
|
||||
|
||||
Reference in New Issue
Block a user