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
This commit is contained in:

committed by
Andrew Kushnir

parent
4d549f69f8
commit
10629600c5
@ -12,7 +12,7 @@
|
||||
"master": {
|
||||
"uncompressed": {
|
||||
"runtime": 1440,
|
||||
"main": 13164,
|
||||
"main": 13411,
|
||||
"polyfills": 45340
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user