perf(ssr): optimize isCircularImport algorithm for large codebases#20085
perf(ssr): optimize isCircularImport algorithm for large codebases#20085hanford wants to merge 7 commits intovitejs:mainfrom
isCircularImport algorithm for large codebases#20085Conversation
isCircularImport check
isCircularImport checkisCircularImport algorithm for large codebases
isCircularImport algorithm for large codebasesisCircularImport algorithm for large codebases
sapphi-red
left a comment
There was a problem hiding this comment.
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. |
|
/ecosystem-ci run |
commit: |
|
📝 Ran ecosystem CI on
✅ ladle, marko, astro, analogjs, nuxt, quasar, one, qwik, react-router, laravel, vite-plugin-react, storybook, vite-environment-examples, sveltekit, vite-plugin-pwa, vitest, rakkas, vuepress, vite-plugin-vue, vite-plugin-svelte, unocss, vike, vite-setup-catalogue, vite-plugin-rsc, vite-plugin-cloudflare |
|
@hanford This PR seems to work fine for the projects in ecosystem-ci. What was the issue you found? |
|
I don't recall if there was a significant performance impact or not. |
|
closing as #21632 is merged |
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