-
-
Notifications
You must be signed in to change notification settings - Fork 219
perf: use failed path to invalidate module cache #2853
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
Conversation
🦋 Changeset detectedLatest commit: 70f4373 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
this looks great locally i can see a huge speed up in createSnapshot too (now <10ms self vs 600 before) |
This makes the test do extra work after everything is done and creates weird race conditions, which I have already tried to fix many times
}); | ||
|
||
if (toRemoves.length) { | ||
moduleCache.deleteByValues(Array.from(toRemoves)); |
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.
is there a reason we clone the array here? does deleteByValues
mutate it?
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.
Eh. I forgot to remove it. toRemoves
was originally a Set
.
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.
all looks good to me 🙏
it runs a lot faster 😄
For svelte-check and editor startup, the change is mainly skipping the cache invalidation check. And for the cache invalidation check, it was scheduled to run before TypeScript builds the program. The check is done by checking the failed file path that TypeScript recorded during module resolution. So it should only run after the first load since we won't have the info before that. |
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.
Awesome!
Alternative to the module cache handling of #2852. Still have to check why the "adding all missing imports" test failed in local.