-
Notifications
You must be signed in to change notification settings - Fork 12k
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
perf(@ngtools/webpack): improve rebuild performance #4188
Conversation
22d3f57
to
5ade81f
Compare
(Hello World is now under 500 msec, so I used Ames instead as benchmark)
Rebuild time was, before this PR (from master, including my PR from yesterday):
|
c09100e
to
e69dd03
Compare
@@ -39,7 +40,7 @@ export class AotPlugin implements Tapable { | |||
private _rootFilePath: string[]; | |||
private _compilerHost: WebpackCompilerHost; | |||
private _resourceLoader: WebpackResourceLoader; | |||
private _lazyRoutes: { [route: string]: string }; | |||
private _lazyRoutes: { [route: string]: string } = Object.create(null); |
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.
Change inline type to use LazyRouteMap
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.
done.
} | ||
} | ||
} | ||
return result; |
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.
result
will always be an empty object, it's not modified after it's created.
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.
Ooops.
4f43b82
to
877467b
Compare
We need to run full static analysis on the first build to discover routes in node_modules, but in rebuilding the app we just need to look for the changed files. This introduces a subtle bug though; if the module structure changes, we might be missing lazy routes if those are in modules imported but weren't in the original structure. This is, for now, considered "okay" as it's a relatively rare case. We should probably output a warning though.
877467b
to
80e4ceb
Compare
We need to run full static analysis on the first build to discover routes in node_modules, but in rebuilding the app we just need to look for the changed files. This introduces a subtle bug though; if the module structure changes, we might be missing lazy routes if those are in modules imported but weren't in the original structure. This is, for now, considered "okay" as it's a relatively rare case. We should probably output a warning though.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
We need to run full static analysis on the first build to discover routes in node_modules, but in rebuilding the app we just need to look for the changed files.
This introduces a subtle bug though; if the module structure changes, we might be missing lazy routes if those are in modules (exclusively from node_modules) imported but weren't in the original structure.
This is, for now, considered "okay" as it's a relatively rare case. We should probably output a warning though.
Mentions: #1980, #4020, #3315