mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-04 23:37:31 +00:00
[PR #3031] [v3] Perf(cnr): Optimize ComfyRegistry startup loading using incremental caching #2961
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#2961
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/3031
Author: @craftingmod
Created: 6/29/2026
Status: 🔄 Open
Base:
main← Head:fix-cache-dir📝 Commits (10+)
edcfb6aChore: Replace print to logging incnr_utils.pyfb822c6Perf(cnr): optimize ComfyRegistry loading using server-time incremental caching.62fd585Merge branch 'main' into fix-cache-dir9a0b2c4perf(cnr): optimize event loop blocking with asyncio.sleep and fix parameter encoding in fetch_allec2023arefactor(cnr): fix cache-miss return type consistency to empty list9a827e4fix(cnr): eliminate client clock fallback dependency on timestamp sync5427efdperf(cnr): add cache 7-day expiration logicf3c003dfix(cnr): propagate asyncio.TimeoutError in _get_cnr_data for correct bubble up5513395fix(cnr): logical error while sync_mode = 'cache'b59eb64perf(cnr): add cache 30-days expiration logic (again)📊 Changes
3 files changed (+217 additions, -77 deletions)
View changed files
📝
glob/cnr_utils.py(+208 -72)📝
glob/manager_core.py(+1 -1)📝
glob/manager_util.py(+8 -4)📄 Description
Summary
This PR significantly optimizes the startup and reload latency of the ComfyRegistry (CNR) node loader.
By replacing the full-fetch mechanism with a
server-time-based incremental sync (delta sync), it reduces the data fetched at boot time from the entire registry database (currently 4,600+ nodes across 150+ pages) to only new or updated nodes since the last run.This reduces the ComfyRegistry sync time on startup from ~50 seconds to less than 1 second under normal conditions.
Problem
Previously,
cnr_utils.pyperformed a full sync of the entire registry database page-by-page (limit=30, hitting the endpoint 150+ times with atime.sleep(0.5)gap) whenever it synced or when the daily cache expired. As the number of custom nodes in the registry continues to grow, this startup latency has organically degraded to over 50 seconds, creating a noticeable delay during ComfyUI boot. (Even if it runs on background, fetching process costs network request onapi.comfyui.organd not avoidable until finish.)How to implemented
https://docs.comfy.org/api-reference/registry/retrieves-a-list-of-nodes#parameter-timestamp
Integrated the
timestampparameter supported byGET https://api.comfy.org/nodesto request only nodes created or updated after the cached timestamp.Related issues
Addresses the performance issues mentioned in #2229 #1950 #1629.
Why PR
Watching every fetch of ComfyUI Nodes is painful while coding custom_nodes...
And after 1.5 years of issue is created, v4 isn't even closed to release on main branch.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.