-
-
Notifications
You must be signed in to change notification settings - Fork 893
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
infra(locales): use mostly async io for generate-locales #2826
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Please also post your performance statistics for comparison. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #2826 +/- ##
=======================================
Coverage 99.95% 99.96%
=======================================
Files 2964 2964
Lines 212544 212544
Branches 948 951 +3
=======================================
+ Hits 212442 212461 +19
+ Misses 102 83 -19 |
so in total it safes a second, cause it utilizes the CPU better 👍 |
And if you run it for all files? |
|
|
Not so sure about this right now. Maybe remove this after all modules are active? Currently, it makes creating PRs really easy, as the only thing you have to do is:
I get that you could "easily" achieve this with a separate script, but this way, every person could create a PR right now. |
but i mean, we already know there are no existing duplicates, because if there were duplicates, the test would fail? |
removing the "new Set" for deduping doesn't seem to speed things up significantly. |
Seems like you can save a significant amount of time (~10 seconds) by returning early if the data is unchanged. This saves pretty-printing and writing out the data if there is no effect: const localeData = normalizeDataRecursive(fileImport.default);
const original = JSON.stringify(fileImport.default);
const modified = JSON.stringify(localeData);
if (original === modified) {
return;
} |
You are totally right. I was thinking about something different. May bad... |
Awesome idea. Here the new results for my machine:
Please confirm the time on your devices as well. |
tested on Mac Pro M1 |
Fixes #2804
time pnpm run generate:locales
Please note that the main perfomance boost in this PR is caused by the
Promise.all
cases.There might be better ways to async everything.
We could also safe up to 2s by removing the
Running data normalization
logs.