perf(@ngtools/webpack): improve rebuild performance#4188
Merged
Conversation
22d3f57 to
5ade81f
Compare
Contributor
Author
|
(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
Brocco
suggested changes
Jan 24, 2017
| private _compilerHost: WebpackCompilerHost; | ||
| private _resourceLoader: WebpackResourceLoader; | ||
| private _lazyRoutes: { [route: string]: string }; | ||
| private _lazyRoutes: { [route: string]: string } = Object.create(null); |
Contributor
There was a problem hiding this comment.
Change inline type to use LazyRouteMap
| } | ||
| } | ||
| } | ||
| return result; |
Contributor
There was a problem hiding this comment.
result will always be an empty object, it's not modified after it's created.
Brocco
approved these changes
Jan 24, 2017
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
MRHarrison
pushed a commit
to MRHarrison/angular-cli
that referenced
this pull request
Feb 9, 2017
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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