Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(ivy): split hooks processing into init and check phases (#32131)
Angular hooks come after 2 flavours: - init hooks (OnInit, AfterContentInit, AfterViewInit); - check hooks (OnChanges, DoChanges, AfterContentChecked, AfterViewChecked). We need to do more processing for init hooks to ensure that those hooks are run once and only once for a given directive (even in case of errors). As soon as all init hooks execute to completion we are only left with the checks to execute. It turns out that keeping track of the remaining init hooks to execute is rather expensive (multiple LView flags reads, writes and checks). But we can observe that non of this tracking is needed as soon as all init hooks are completed. This PR takes advantage of the above observations and splits hooks processing functions into: - init-specific (slower but less common); - check-specific (faster and more common). NOTE: there is code duplication in this PR and it is left like this intentinally: hand-inlining this perf-critical code makes the view refresh process substentially faster. PR Close #32131
- Loading branch information
1 parent
4d549f6
commit 1062960
Showing
8 changed files
with
151 additions
and
77 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
"master": { | ||
"uncompressed": { | ||
"runtime": 1440, | ||
"main": 13164, | ||
"main": 13411, | ||
"polyfills": 45340 | ||
} | ||
} | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.