-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
perf(ssr): optimize isCircularImport
algorithm for large codebases
#20085
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
base: main
Are you sure you want to change the base?
Conversation
isCircularImport
check
isCircularImport
checkisCircularImport
algorithm for large codebases
isCircularImport
algorithm for large codebasesisCircularImport
algorithm for large codebases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This is nice.
Startup time dropped noticeably in our big repo
Do you have a concrete value of this? I understand that the performance should improve theoretically due to the reduced algorithmic complexity, but I’m curious about the actual numbers.
I can share concrete numbers tomorrow morning! |
I think I found some issues with this approach, will report back after taking a deeper look |
I'll convert this to draft for now. |
Description
I swapped out the old recursive “visited” set for a simple 3-state map (unvisited, visiting, done) that walks each module only once. As soon as we hit a module marked “visiting,” we know there’s a cycle and bail out.
Why It Matters
fixes #20084