Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ./routes/utils.ts functions to use object for O(1) lookups #51

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MistrBones
Copy link

I was having problem with the browser causing a hang on ComfyUI launch due to my large number of files. I traced the problem to the processFile function which is searching for json files relying on the findFile function which is naively looping over the entire list of images causing the number of iterations to grow at a rate of O(n^2). This can be fixed by changing the return value of fetchFiles to a map allowing O(1) lookup times. I've updated the necessary functions to enable this change/fix this issue.

Resolves issue #49

Resubmitting with clean commit history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant