-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Set of performance improvements #31839
Set of performance improvements #31839
Conversation
f03bc28
to
2646f3c
Compare
@@ -22,6 +22,18 @@ Great reads: | |||
|
|||
See benchmark [here](https://jsperf.com/mono-vs-megamorphic-property-access). | |||
|
|||
## Packed vs. holey Array |
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.
thanks for adding this!
const blueprint = ngDevMode ? new LViewBlueprint !(initialViewLength) : | ||
Array.apply(null, Array(initialViewLength)); | ||
|
||
blueprint.fill(null, 0, bindingStartIndex).fill(NO_CHANGE, bindingStartIndex) as LView; |
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.
I think there is much better way to do this.
const blueprint = ngDevMode ? new LViewBlueprint !() : [];
blueprint.fill(null, 0, bindingStartIndex).fill(NO_CHANGE, bindingStartIndex, initialViewLength) as LView;
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.
This won't work as .fill
doesn't write past the array length. I've pushed an alternative (if we don't want to use the "apply" trick):
const blueprint = ngDevMode ? new LViewBlueprint !() : [];
for (let i = 0; i < initialViewLength; i++) {
blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);
}
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.
Really? OK.
9a738d8
to
98a4a57
Compare
98a4a57
to
6b70b59
Compare
Adding "cleanup" label to indicate that the size limit needs an update (as per discussion due the team sync), so that |
setPreviousOrParentTNode is set in enterView so no need to reset it just before entering a view.
6b70b59
to
be908c7
Compare
@AndrewKushnir I've updated the size limit, as discussed. I did it in a separate commit and update to the same value as in the @crisbeto PR #31845 so we are not generating conflicts (or can drop the commit in question if needed). |
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.
perf(aio): update main bundle size
This does not seem like the correct commit message.
- the subject we use is now docs-infra (aio is deprecated as a subject)
- should it be type perf? I would expect build or ci or even test
Also it would be really helpful for future readers if you explain in the commit message why this has been done (and mention the discussion).
1c22891
to
e6b598a
Compare
PR angular#31839 contains perf and code cleanup changes that add 48 bytes to the main bundle size. Perf gains and code clarity justify this increase. Unfortunately the size verification job is rejecting this PR as it reports size gains from a fixed size and not relative increase of size from a particular PR. It was decided during the internal team discussion to bump up size limits to correctly reflect current state of the master and increase from this PR.
e6b598a
to
65798b7
Compare
PR #31839 contains perf and code cleanup changes that add 48 bytes to the main bundle size. Perf gains and code clarity justify this increase. Unfortunately the size verification job is rejecting this PR as it reports size gains from a fixed size and not relative increase of size from a particular PR. It was decided during the internal team discussion to bump up size limits to correctly reflect current state of the master and increase from this PR. PR Close #31839
…ngular#31839) setPreviousOrParentTNode is set in enterView so no need to reset it just before entering a view. PR Close angular#31839
…ries defined (angular#31839) PR Close angular#31839
PR angular#31839 contains perf and code cleanup changes that add 48 bytes to the main bundle size. Perf gains and code clarity justify this increase. Unfortunately the size verification job is rejecting this PR as it reports size gains from a fixed size and not relative increase of size from a particular PR. It was decided during the internal team discussion to bump up size limits to correctly reflect current state of the master and increase from this PR. PR Close angular#31839
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. |
No description provided.