-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: improve docgen perf #14590
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
chore: improve docgen perf #14590
Conversation
I think @ecraig12345 should probably take a look here as well, seems reasonable. |
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.
Seems reasonable, but @ecraig12345 might be able to spot something better here.
This is definitely better, but it still awful 😨 I don't have the explanation why it slow downs on some files. @ecraig12345 any ideas?
|
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Potential regressions comparing to master
Perf comparison
Perf tests with no regressions
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: a4a4ea6b7c60bdf605bbc884b37120590050f79c (build) |
Co-authored-by: Elizabeth Craig <[email protected]>
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9262503:
|
…ntui into chore/docgen-perf
This change was reverted as we have circular references in our code 😭 |
Description of changes
This is heavily based on work that @ecraig12345 did in #12897. However, the actual implementation is inspired by strothj/react-docgen-typescript-loader#40. The idea is still the same - to reuse the same
ts.Program
as it's quite heavy. Direct requires of component's files were also removes to parsedefaultProps
we reuse existing AST produced by Babel.This allows to speed up
build:component-info
without caching it takes around 100-110 seconds on machine.Previous PRs:
Finished 'build:docs:assets:component:info' after 5.35 min
This PR:
Finished 'build:docs:assets:component:info' after 1.57 min
Another change is the lazy evaluation for@babel/plugin-transform-modules-commonjs
. This improves initial load time of modules because dependencies will be evaluated based on their usage.