-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
refactor: simplify crawlEndFinder #12868
Conversation
Run & review this pull request in StackBlitz Codeflow. |
We have a missing test to check if when running I pushed In So the PR after |
if (!workersSources.has(id)) { | ||
registeredIds.add(id) | ||
done() | ||
.catch(() => {}) |
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.
Because of this catch
, which has been around for a long time in different forms, we may be swallowing some load errors during dev. If you remove it, you'll see Vitest complaining about unhandled errors. We need to review this in another PR (this PR doesn't change things but it makes more clear that we are doing it).
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
50ms (0.5%) improvement on fcp 1k components: https://github.com/vitejs/vite-benchmark/actions/runs/4706700049 Edit: ok, it is for the k-means, when checking the details, there is only a small improvement in mean and median. @fi3ework, maybe we should get back to using the mean as the main metric? |
@patak-dev I would prefer median more with a simple swipe off the extremely outlier which is easy to be recognized 👀. The downside of mean is it's still easy to be effected to some slight outliner with a vague definition of "extremely outlier" define. After several PR's results, do you also think median is good enough 🤔? |
I'm good with using median, and in that case, I don't think we need to remove the outliers, the median would already do itself by choosing the value in the middle. The effect or removing N outliers in both extremes should be a non op |
test: check no missing deps in build time adds a check that will fail with the reverted commits 969ff9f (#12868) and de0323f (#12868), and would also have failed (if the log would have been there) with 4.2.1. |
Merging so we have a few days to test this one while we are still in beta. |
Description
Simplify crawlEndFinder, it seems we can avoid creating promises by using timeouts.
See #12851 for reference.
The idea is from a discussion with @dominikg. He actually proposed splitting
delayDepsOptimizerUntil(id, done)
intodelayDepsOptimizerUntil(id) + markIdAsDone(id)
and callmarkIdAsDone(id)
without a promise during build (using themoduleParsed
hook). I tried this but I couldn't make it work (I think it may work in case someone wants to take a look).But this already is way simpler, we could measure perf too but I don't expect a difference.
What is the purpose of this pull request?